Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
atomflunder committed Apr 24, 2022
0 parents commit 7ec474d
Show file tree
Hide file tree
Showing 20 changed files with 513 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug report
about: Create a report to help improve the library
title: 'Bug report: [Very brief summary of the bug]'
labels: bug
assignees: atomflunder

---

<!-- Thanks for taking the time to fill out a bug report.
It will be reviewed as soon as possible. -->

**Summary**:
A clear and concise description of what the bug is.

**Reproduction**:
Steps to accurately reproduce the behavior.

**Expected behavior**:
A clear and concise description of what you expected to happen.

**Actual behavior**:
Describe what actually happens instead.

**Additional context**:
Add any other context about the problem here.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an addition to improve the library
title: 'Feature request: [Very brief description of the feature]'
labels: enhancement
assignees: atomflunder

---

<!-- Thanks for taking the time to fill out a feature request.
It will be reviewed as soon as possible. -->

**Description**:
A clear and concise description of what the feature would be.

**Why do you want this feature to be added**:
Describe how this feature would be beneficial to the bot.

**Your preferred solution**:
A clear and concise description of what you want to happen.

**Additional context**:
Add any other context or screenshots about the feature request here.
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Thanks for taking the time to submit a pull request.
It will be reviewed as soon as possible. -->

## Summary

[Explanation of what your PR fixes or adds.]

## Checklist
<!-- Put an x inside [ ] to check it: [x] -->

- [ ] This PR makes changes to the functionality of the code.
- [ ] This PR fixes a bug.
- [ ] This PR adds something new.
- [ ] **I have tested the changes made.**

- [ ] This PR fixes typos in the code or errors in the documentation.
- [ ] Other/Not described.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.9"

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -U -r requirements.txt
- name: Build distributions
run: |
python ./setup.py sdist bdist_wheel
24 changes: 24 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Linting

on: [push, pull_request]

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black isort
- name: Run isort
run: |
isort . --check --profile "black"
- name: Run black
run: |
black . --check --verbose
25 changes: 25 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and pytest
run: |
python -m pip install --upgrade pip
pip install -r ./requirements.txt
pip install pytest
- name: Run tests
run: |
pytest -v
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/venv/
/.pytest_cache/
/.vscode/
*/__pycache__/
/build/
/dist/
/*.egg-info/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 atomflunder

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Searchlib

A library for searching and comparing strings. WIP
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[tool.black]
line_length=88

[tool.isort]
profile="black"
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
levenshtein
Unidecode
6 changes: 6 additions & 0 deletions searchlib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from .match import Match
from .strings import Strings

__all__ = ["Match", "Strings"]
__title__ = "searchlib"
__version__ = "0.0.1"
10 changes: 10 additions & 0 deletions searchlib/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class EmptySearchException(Exception):
"""Exception that will get raised when you try to compare an empty string to something."""

pass


class InvalidLimitException(Exception):
"""Exception that will get raised when you try to set a limit that is less than 1."""

pass
Loading

0 comments on commit 7ec474d

Please sign in to comment.