Skip to content

Commit a69c8a2

Browse files
committed
Merge branch 'documantation' into 'main'
doc: Add new documentation and enhance module structure references See merge request onix-systems/python-internal-privat!6
2 parents 0fe272e + 8d3d5ee commit a69c8a2

30 files changed

+1683
-30
lines changed

.readthedocs.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
3+
4+
sphinx:
5+
configuration: docs/source/conf.py
6+
7+
build:
8+
os: "ubuntu-22.04"
9+
tools:
10+
python: "3.10"
11+
12+
python:
13+
install:
14+
- method: pip
15+
path: .
16+
- requirements: requirements.txt

CONTRIBUTING.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Contributing to Python-Pin-Payments Library
2+
3+
First off, thank you for considering contributing to Python-Pin-Payments Library! It's people like you that make this project great!
4+
5+
## Code of Conduct
6+
7+
This project and everyone participating in it is governed by the [Python-Pin-Payments Library Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [viacheslav.lisovoi@onix-systems.com](mailto:viacheslav.lisovoi@onix-systems.com).
8+
9+
## How Can I Contribute?
10+
11+
### Reporting Bugs
12+
13+
This section guides you through submitting a bug report for Python-Pin-Payments Library. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports.
14+
15+
#### Before Submitting A Bug Report
16+
17+
- **Perform a cursory search** to see if the bug has already been reported. If it has and the issue is still open, add a comment to the existing issue instead of opening a new one.
18+
19+
#### How Do I Submit A (Good) Bug Report?
20+
21+
Bugs are tracked as GitHub issues. After you've determined that a bug hasn't been filed, create an issue and provide the following information by filling in the template.
22+
23+
- **Use a clear and descriptive title** for the issue to identify the problem.
24+
- **Describe the exact steps** which reproduce the problem in as many details as possible.
25+
- **Provide specific examples** to demonstrate the steps. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples.
26+
- **Describe the behavior you observed** after following the steps and point out what exactly is the problem with that behavior.
27+
- **Explain which behavior you expected to see** instead and why.
28+
- **Include screenshots** which show you following the described steps and clearly demonstrate the problem.
29+
- **If you're reporting that the library crashed**, include a crash report with a stack trace from the program.
30+
- **If the problem is related to performance**, include a CPU profile capture of the execution of the affected functions.
31+
32+
### Suggesting Enhancements
33+
34+
This section guides you through submitting an enhancement suggestion for Python-Pin-Payments Library, including completely new features and minor improvements to existing functionality.
35+
36+
#### Before Submitting An Enhancement Suggestion
37+
38+
- **Perform a cursory search** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
39+
40+
#### How Do I Submit A (Good) Enhancement Suggestion?
41+
42+
Enhancement suggestions are tracked as GitHub issues. After you've determined that the enhancement hasn't been filed, create an issue and provide the following information:
43+
44+
- **Use a clear and descriptive title** for the issue to identify the suggestion.
45+
- **Provide a step-by-step description of the suggested enhancement** in as much detail as possible.
46+
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
47+
- **Include screenshots and code snippets** which demonstrate the use of the suggested enhancement.
48+
49+
### Your First Code Contribution
50+
51+
- **Get started with our documentation**: follow the setup instructions in the README.md file.
52+
- **Check for open issues**: start by looking through the [issues](https://github.com/yourusername/python-pin-payments/issues).
53+
54+
### Pull Requests
55+
56+
The process described here has several goals:
57+
58+
- Maintain the project's quality
59+
- Fix problems that are important to users
60+
- Engage the community in working toward the best possible Python-Pin-Payments Library
61+
- Enable a sustainable system for maintainers to review contributions
62+
63+
Please follow these steps to have your contribution considered by the maintainers:
64+
65+
1. **Create a branch** for your contribution.
66+
2. **Write tests** for your changes.
67+
3. **If you added code that should be tested, add tests**.
68+
4. **Ensure the test suite passes**.
69+
5. **Make sure your code lints**.
70+
6. **Submit a pull request** through the GitHub.
71+
72+
Code Style
73+
----------
74+
75+
- Follow the [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide.
76+
- Ensure that the code passes all linting checks.
77+
78+
Tests
79+
-----
80+
81+
- Use [pytest](https://pytest.org/) for testing.
82+
- Ensure all tests pass before submitting a pull request.
83+
84+
Licensing
85+
---------
86+
87+
By contributing to Python-Pin-Payments Library, you agree that your contributions will be licensed under the MIT License.

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Onix-Systems
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

docs/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = ./source
9+
BUILDDIR = ./build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/source/conf.py

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import sys
2+
import os
3+
import django
4+
5+
6+
sys.path.insert(0, os.path.abspath('../../'))
7+
print(sys.path)
8+
# Set the environment variable for Django settings to the new settings file
9+
os.environ['DJANGO_SETTINGS_MODULE'] = 'privatbank_api_client.drf_privat.sphinx_settings'
10+
11+
# Initialize Django
12+
django.setup()
13+
# -- General configuration ---------------------------------------------------
14+
extensions = [
15+
'sphinx.ext.autodoc',
16+
'sphinx.ext.napoleon',
17+
'sphinx.ext.viewcode',
18+
]
19+
project = 'Python-privatbank-api-client Library'
20+
copyright = '2024, Onix-Systems'
21+
author = 'Onix-Systems'
22+
release = '1.0'
23+
24+
templates_path = ['_templates']
25+
26+
exclude_patterns = []
27+
28+
# -- Options for HTML output -------------------------------------------------
29+
30+
html_theme = 'sphinx_rtd_theme'
31+
html_static_path = ['_static']
32+
html_theme_options = {
33+
"collapse_navigation": False, # Keeps the menu expanded
34+
"navigation_depth": 4, # Adjust the depth of navigation in the sidebar
35+
"titles_only": False # Ensures subheadings are part of the ToC
36+
}
37+
38+
# Napoleon settings for Google style docstrings
39+
napoleon_google_docstring = True
40+
napoleon_numpy_docstring = False
41+
42+
numpydoc_show_class_members = False

docs/source/contributing.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Contributing
2+
============
3+
4+
Please read `CONTRIBUTING.md`_ for details on our code of conduct, and the process for submitting pull requests to us.
5+
6+
.. _CONTRIBUTING.md: https://github.com/Onix-Systems/python-pin-payments/blob/master/CONTRIBUTING.md

docs/source/index.rst

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. raw:: html
2+
3+
<div style="text-align: right;">
4+
<a href="https://github.com/Onix-Systems/python-privatbank-client" target="_blank">Source repository on GitHub</a>
5+
</div>
6+
7+
PrivatBank API client documentation
8+
===================================
9+
10+
.. toctree::
11+
:maxdepth: 2
12+
:caption: Contents:
13+
14+
overview
15+
installation
16+
usage
17+
contributing
18+
license
19+
modules
20+

docs/source/installation.rst

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Installation
2+
=============
3+
**This framework is published at the PyPI, install it with pip:**
4+
5+
1. This package makes it possible to use module methods in synchronous frameworks:
6+
7+
.. code-block:: bash
8+
9+
pip install privatbank-api-client[http]
10+
11+
2. This package makes it possible to use module methods in asynchronous frameworks:
12+
13+
.. code-block:: bash
14+
15+
pip install privatbank-api-client[aio]
16+
17+
3. This package makes it possible to use ready-made views with a synchronous script based on the Django Rest framework:
18+
19+
.. code-block:: bash
20+
21+
pip install privatbank-api-client[drf]
22+
23+
To get started, add the following packages to ``INSTALLED_APPS``:
24+
25+
.. code-block:: python
26+
27+
INSTALLED_APPS = [
28+
...
29+
'rest_framework',
30+
'drf_privat',
31+
]
32+
33+
Include ``drf_mono`` urls to your ``urls.py``:
34+
35+
.. code-block:: python
36+
37+
urlpatterns = [
38+
...
39+
path('privat/', include('drf_privat.urls', namespace='drf_privat')),
40+
]
41+
42+
4. This package makes it possible to use ready-made routers with an asynchronous script based on the FastAPI framework:
43+
44+
.. code-block:: python
45+
46+
pip install privatbank-api-client[fastapi]
47+
48+
5. To install all packages at once:
49+
50+
.. code-block:: python
51+
52+
pip install privatbank-api-client[all]

docs/source/license.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
License
2+
=======
3+
4+
This project is licensed under the MIT License - see the `LICENSE.md`_ file for details.
5+
6+
.. _LICENSE.md: https://github.com/Onix-Systems/python-pin-payments/blob/master/LICENSE.md
7+
8+

docs/source/modules.rst

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Privat Bank API
2+
===============
3+
4+
Asynchronous API Manager
5+
-------------------------
6+
.. automodule:: privatbank_api_client.async_privat.manager
7+
:members:
8+
:undoc-members:
9+
:show-inheritance:
10+
11+
Synchronous API Manager
12+
------------------------
13+
.. automodule:: privatbank_api_client.sync_privat.manager
14+
:members:
15+
:undoc-members:
16+
:show-inheritance:
17+
18+
FastAPI Router
19+
--------------
20+
.. automodule:: privatbank_api_client.fastapi_privat.router
21+
:members:
22+
:undoc-members:
23+
:show-inheritance:
24+
25+
Django Rest Framework Views
26+
---------------------------
27+
28+
.. automodule:: privatbank_api_client.drf_privat.views
29+
:members:
30+
:undoc-members:
31+
:no-index:
32+

docs/source/overview.rst

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
Overview
3+
========
4+
This project provides an interface to interact with the **PrivatBank API**, enabling efficient and seamless integration of its services within applications.
5+
**Key Functionalities:**
6+
- Fetching exchange rates.
7+
- Account balance inquiries.
8+
- Transaction histories.
9+
- Payment processing.
10+
**Core Aim:**
11+
- Simplify access to the **PrivatBank API**.
12+
- Allow developers to implement banking functions quickly without handling low-level API details.
13+
14+

docs/source/usage.rst

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Usage
2+
=====
3+
The examples below demonstrate how to effectively use the provided modules. Each example illustrates the key functionalities and best practices to work with the respective manager classes.
4+
5+
6+
.. toctree::
7+
:maxdepth: 2
8+
:caption: Usage Examples
9+
:titlesonly:
10+
:hidden:
11+
12+
usages/async_manager
13+
usages/sync_manager
14+
usages/drf_app
15+
usages/async_app

0 commit comments

Comments
 (0)