Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
643db90
Merge pull request #22 from b3yc0d3/develop version 2.1.0
b3yc0d3 Dec 31, 2024
c38cf31
docs: initial sphinx docs implementation
ripariancommit Apr 8, 2025
8d5f1d7
docs/conf: add the intersphinx extension
ripariancommit May 3, 2025
0ab60cf
rule34: update module documentation
ripariancommit May 3, 2025
73ade39
rule34Py: update package docstring
ripariancommit May 3, 2025
f9ef360
docs: remove old README document
ripariancommit May 3, 2025
3bd837e
docs: add downloader tutorial
ripariancommit May 3, 2025
2859a74
pyproject.toml: add documentation dependencies
ripariancommit May 14, 2025
3eba46e
.github: add pr check workflow
ripariancommit May 14, 2025
ad92ff1
.github: add windows pr-check job
ripariancommit May 14, 2025
0bb1b25
Add project Makefile
ripariancommit May 14, 2025
ad26e32
.github: add GH pages workflow
ripariancommit May 15, 2025
4f10359
rule34Py: document the post module
ripariancommit May 15, 2025
c288002
rule34Py: document the api_urls module
ripariancommit May 15, 2025
5016463
rule34Py: document the html module
ripariancommit May 15, 2025
be82d6e
rule34Py: document the icame module
ripariancommit May 15, 2025
8f7382b
conf.py: stop documenting class __init__() methods
ripariancommit May 15, 2025
35f14dc
rule34Py: document the pool module
ripariancommit May 15, 2025
4900b2b
rule34Py: document the post_comment module
ripariancommit May 16, 2025
f2f1ebc
rule34Py: document the toptag module
ripariancommit May 17, 2025
e1d93b4
rule34Py: update module docstrings
ripariancommit May 17, 2025
3790346
rule34Py: update __vars__ docstrings
ripariancommit May 17, 2025
b865bcd
Use ruff to lint the project
ripariancommit May 17, 2025
a4ad6b4
rule34Py: lint and fixup docstrings
ripariancommit May 17, 2025
6eab0cd
decs/index: Split the TOC into sections
ripariancommit May 17, 2025
ac54f34
.github: lint PRs during pr-checks
ripariancommit May 17, 2025
499bc56
Move README content into docs/
ripariancommit May 17, 2025
4f57a1e
Move contributing info to documentation
ripariancommit May 17, 2025
433f310
rule34Py: fixup __init__ docs in Post
ripariancommit May 17, 2025
e85acda
docs: add captcha-clearance guide
ripariancommit May 17, 2025
b17fd76
.github: remove dev/docs trigger from gh-pages
ripariancommit May 17, 2025
a418c8c
README: fixup documentation link
ripariancommit May 17, 2025
b790977
Merge pull request #24 from ripariancommit/dev/docs
b3yc0d3 May 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/actions/build-project/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build the project
description: Installs project dependencies and builds the project

inputs:
latest_python:
default: false

runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ">=3.5"
check-latest: ${{ inputs.latest_python }}

- name: Build documentation
shell: bash
run: |
python3 -m pip install .[docs]
make html
28 changes: 28 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish GH Pages

on:
push:
branches:
- master

permissions:
contents: write
pages: write
id-token: write

jobs:
build-docs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build the project
uses: ./.github/actions/build-project

- name: Deploy to Github Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/html
44 changes: 44 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: PR Checks

on:
pull_request:
branches:
- "**"

jobs:
build-linux:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build the project
uses: ./.github/actions/build-project
with:
latest_python: true # always use the latest python in PR checks

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-${{ github.run_id }}-${{ github.run_number }}
path: ./build
retention-days: 14

- name: Lint the project
shell: bash
run: |
python -m pip install .[dev]
make lint


build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build the project
uses: ./.github/actions/build-project
with:
latest_python: true # always use the latest python in PR checks
69 changes: 69 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

.DEFAULT_GOAL = all

PROJECT = rule34py
VERSION = $(shell git describe --tags)

PYTHON3 ?= python3
PYTHON_BUILD = $(PYTHON3) -m build
RUFF = $(PYTHON3) -m ruff
SPHINX_BUILD = $(PYTHON3) -m sphinx
PYTEST = $(PYTHON3) -m pytest

builddir ?= build
srcdir = rule34Py

# Installation Directories
prefix ?= /usr/local

docdir ?= $(prefix)/share/doc/$(project)
htmldir ?= $(docdir)/html


# REAL TARGETS #
################


# PHONY TARGETS #
#################

all : html
$(PYTHON3) -m build --wheel --outdir $(builddir) --verbose
.PHONY : all


check :
PYTHONPATH=$(srcdir)/.. $(PYTEST) tests/unit/
.PHONY : check


clean : mostlyclean
find ./ -depth -path '**/.pytest_cache*' -print -delete
find ./ -depth -path '**/__pycache__*' -print -delete
$(RUFF) clean
.PHONY : clean


dist :
$(PYTHON_BUILD) --sdist --outdir $(builddir)
.PHONY : dist


distclean : clean
.PHONY : distclean


html :
$(SPHINX_BUILD) --builder html docs $(builddir)/html
.PHONY : html


lint :
$(RUFF) check $(srcdir)
.PHONY : lint


mostlyclean :
rm -rf $(builddir)
find ./ -depth -path '**/rule34Py.egg-info*' -print -delete
.PHONY : mostlyclean
4 changes: 3 additions & 1 deletion NOTICE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# NOTICE

The following third-party software is used in this project:

# Responses
## Responses
* Licensed under the Apache License, Version 2.0
* Copyright (c) David Cramer

Expand Down
87 changes: 14 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,25 @@

![GPL-3.0](https://img.shields.io/github/license/b3yc0d3/rule34Py) [![](https://img.shields.io/pypi/v/rule34Py)](https://pypi.org/project/rule34Py/) [![](https://img.shields.io/pypi/dm/rule34py?color=blue)](https://pypi.org/project/rule34Py/)

Python api wrapper for [rule34.xxx](https://rule34.xxx/).
Python API wrapper for [rule34.xxx](https://rule34.xxx/).
</div>

## Getting Started

#### Install it using pip
```
pip install rule34py
```
## Installation

#### Building it from Source
```
git clone https://github.com/b3yc0d3/rule34Py.git
cd rule34Py
python3 -m build
[rule34Py](https://pypi.org/project/rule34Py/) is available directly from the Python Package Index and can be installed via `pip`.

```bash
pip install rule34Py
```

## Documentation
You can find the documentation [here](https://github.com/b3yc0d3/rule34Py/tree/master/docs).
Or you can build it from source using this project.
See the [Developer Guide](https://b3yc0d3.github.io/rule34Py/dev/developer-guide.html) for more information.


> [!NOTE]
> The documentation might move in the future.
## Quickstart

## Code Snippet
```py
```python
from rule34Py import rule34Py
r34Py = rule34Py()

Expand All @@ -54,62 +48,9 @@ random = r34Py.random_post()
random_id = r34Py.random_post_id()
```

## Development
Follow these steps to setup everything needed to develop on rule34Py.

Currently this setup guide only shows how it is done on unix-like systems.

### Clone This Repository
```
git clone https://github.com/b3yc0d3/rule34Py.git

cd rule34Py

git checkout develop
```

### Setting Up Virtual Python Environment
```
python -m venv venv

source venv/bin/activate
```

To deactivate the virtual environment type the following in your terminal
```
deactivate
```

### Install and Build rule34Py in the Virtual Environment
```
python3 -m build

pip install -e .
```


### Running the Test Suite

This project is tested by an organic `pytest` suite, stored under the `:tests/` directory.

See the [`tests/README.md`](./tests/README.md) file for instructions on how to run the test suite.


### Committing your Changes
- Branch name should be prefixed with
- `fix-` when fixing an bug/error
- `feat-` when a feature got added
- `chore-` everything else that doesn't fall in the above categories
- The title must be descriptive, what your pull request changes/does.
- Write a breve description of what the pull request does/solves in the commit.
- If your pull request fixes an issue, please mention that issue in the commit title.

Example structure of a commit message
```
here goes the title of the commit
## Documentation

Here goes the description
```
This project has extensive [documentation](https://b3yc0d3.github.io/rule34Py/), hosted on the upstream Github Pages. It includes additional **Tutorials**, **User Guides**, **API Documentation**, and more.

The title shall not be longer then 50 characters.
**Select the `develop` branch for pull requests.**
See the [Contributing Guide](https://b3yc0d3.github.io/rule34Py/dev/contributing.html) for information about how to contribute to this project and file bugs.
Loading