Skip to main content

MoyNalogPy

MoyNalogPy - библиотека на Python для работы с API сервиса "Мой налог" ФНС России, предназначенная для самозанятых.

Установка

pip install moy-nalog

Перед началом работы

Для начала работы с библиотекой необходимо пройти аутентификацию:

python authOLD.py

После выполнения этой команды будут сохранены необходимые учетные данные для дальнейшей работы с API.

Возможности

  • Получение данных о профиле пользователя
  • Работа с доходами и чеками
  • Взаимодействие с сервисами и клиентами

Использование

Инициализация

from MoyNalogPy import MoyNalog

# Инициализация клиента
api = MoyNalog(inn="ваш_инн", password="ваш_пароль")

Получение данных профиля

# Получить профиль пользователя
profile = api.get_user_profile()
print(profile)

Работа с доходами

# Получить список доходов
incomes = api.get_incomes()
print(incomes)

Работа с чеками

# Создание чека
from MoyNalogPy.schemas import Service, Client
from MoyNalogPy import MoyNalog

my_nalog = MoyNalog()

# Создаем объект услуги
service = Service(
    name="Консультация по программированию",
    quantity=1,
    amount=2000.0,
    serviceNumber=1
)

# Создаем объект клиента
client = Client(
    displayName="Иванов Иван Иванович",
    inn="7712345678",
    type="LEGAL_ENTITY"
)

# Вызываем метод создания чека
approvedReceiptUuid = my_nalog.create_invoice(
    operationTime='2023-10-01T12:00:00+03:00',
    svs=service,
    client=client
)

# Получаем URL чека для печати
receipt_url = my_nalog.get_receipt_url(approvedReceiptUuid)
print(receipt_url)

Так же можно получить сразу ссылку на чек:

receipt_url = my_nalog.create_invoice(
    operationTime='2023-10-01T12:00:00+03:00',
    svs=service,
    client=client,
    return_recipt_url=True
)

## Требования

- Python 3.8+
- requests
- pydantic

## Лицензия

MIT

## Автор

senylar (senyvlar@gmail.com)

## Исходный код

GitHub: [https://github.com/senylar/MoyNalogPy](https://github.com/senylar/MoyNalogPy)

Metadata

Release files for moy-nalog-py 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moy-nalog-py 0.2.1
File Size Uploaded
moy_nalog_py-0.2.1.tar.gz 8.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for moy-nalog-py 0.2.1
File Interpreter ABI Platform
moy_nalog_py-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.6 kB

Release files / moy_nalog_py-0.2.1.tar.gz

Download URL moy_nalog_py-0.2.1.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e5d650ed99a361e3396a3a1081f994d2e11a075af3dcc6ecaa918df056f88a79
BLAKE2b-256 checksum
How to use checksums
2e4d7431761f5d866585d562ba5cd5b0c26f0a5b2965f68cbb941147a3b97d89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.

Transparency log

Release files / moy_nalog_py-0.2.1-py3-none-any.whl

Download URL moy_nalog_py-0.2.1-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f722d2bf1c4f270dbee0845803a012241d56df30df6534f532f89204b73acdd2
BLAKE2b-256 checksum
How to use checksums
eeca349cd6083aceeb63b4d1ac14de975f58ea8bcefa0d6876266c9e02d72fdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page