Skip to content

Conversation

@b3yc0d3
Copy link
Owner

@b3yc0d3 b3yc0d3 commented Aug 30, 2025

Older versions of this library will no longer work, do to an REST Api change

This closes issue #35

Added

  • Added a rule34Py.autocomplete method.
  • Added AutocompleteTag class.
  • Added parameter to rule34Py.search method for excluding ai generated content.
    • Added unit test

Changed

  • Updated API wrapper to support website’s new authentication system.
  • The underlying website API now requires authentication (api_key and user_id) for all requests.
  • Updated unit tests.

ripariancommit and others added 28 commits June 14, 2025 19:37
The __vars__ module contains dundered variables that are either (a)
module-level metadata like '__version__' or (b) static API endpoint
URLs.

Condense the codebase by moving the metadata into the package __init__
and the API endpoints into the api_urls module.

Signed-off-by: Riparian Commit <ripariancommit@protonmail.com>
Python community tooling generally assumes that module `__author__` and
`__email__` dunders are simple strings, rather than sets or lists.

Signed-off-by: Riparian Commit <ripariancommit@protonmail.com>
The project currently uses setuptools, build, and twine to coordinate
project build and publishing steps. And it leaves the business of
managing the python environment as an exercise to the user.

Further, the current setuptools pyproject implementation does not
correctly handle Maintainership contact information, and the python
dependencies are slightly messed up.

We should instead use poetry - which is a modern build tool for python
that most of our dependencies use - to manage the python venv and
coordinate dependencies.

Signed-off-by: Riparian Commit <ripariancommit@protonmail.com>
The sphinx linkcheck "builder" validates that documentation hyperlinks
(anchors) are not broken.

Use this facility within the `lint` make target.

Signed-off-by: Riparian Commit <ripariancommit@protonmail.com>
Add a unit test module which validates package metadata.

Signed-off-by: Riparian Commit <ripariancommit@protonmail.com>
The modern (post-PEP440) standard for distributing package metadata is
to make use of the package PKG-INFO file and the importlib.metadata
standard module.

Remove the obsolete module-level __author__ and __version__ dunders,
along with the rule34Py.version() method, in favor of the package
metadata.

Add a new guide, explaining to users how to extract the metadata.

Signed-off-by: Riparian Commit <ripariancommit@protonmail.com>
It is somewhat confusing to have git-ignore entries that aren't used by
tools in the project.

Remove unused pattern entries.

Signed-off-by: Riparian Commit <ripariancommit@protonmail.com>
Use poetry for project tooling. Deprecate module metadata.
Remove unused entries from .gitignore file
Replaces the initial implementation of the autocomplete feature with a
reworked version based on reviewer feedback and upstream changes.

Changes include:
- Added autocomplete() method to the rule34Py class for tag suggestions based on partial input
- Results are ordered by popularity and include Referer/Origin headers for compatibility
- Refactored AutocompleteTag into a @DataClass for cleaner structure and type safety
- Moved __autocomplete_url__ to api_urls.py
- Reordered methods in rule34Py class alphabetically for consistency

Also includes:
- Comprehensive unit tests with recorded responses (R34_RECORD_RESPONSES=True)
- Tests validate response types, attributes, and ordering of results

This commit replaces the previous incomplete implementation and aligns with current codebase structure and standards.
Added tag autocomplete functionality

- New autocomplete() method in rule34.py with full type hints and docs
- AutocompleteTag class in autocomplete_tag.py with property accessors
- Added AUTOCOMPLETE URL constant in vars.py
- Updated API_URLS with new URL for autocomplete
Took me waaaay to long to get the tests working again.
…ixes #35

Added api credential properties to rule34Py class
Users now can exclude ai generated content from their search resulsts
by setting ``exclude_ai`` to True for the search function.

   import rule34Py as r34

   client = r34.rule34Py()

   client.api_key="API_KEY"
   client.user_id="USER_ID"

   results = client.search(["neko"], exclude_ai=True)
Users now can exclude ai generated content from their search resulsts
by setting ``exclude_ai`` to True for the search function.

   import rule34Py as r34

   client = r34.rule34Py()

   client.api_key="API_KEY"
   client.user_id="USER_ID"

   results = client.search(["neko"], exclude_ai=True)
AI generated content can now be excluded from the search, by setting the ``exclude_ai`` parameter to **True** at the `rule34Py.search` method.
@b3yc0d3 b3yc0d3 added documentation Improvements or additions to documentation enhancement New feature or request labels Aug 30, 2025
@b3yc0d3 b3yc0d3 added the fixed Something didn't work, now it does label Aug 30, 2025
@b3yc0d3 b3yc0d3 merged commit fb93d88 into master Aug 30, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request fixed Something didn't work, now it does

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants