
Research
Node.js Fixes AsyncLocalStorage Crash Bug That Could Take Down Production Servers
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.
amocrm-api
Advanced tools
.. image:: https://travis-ci.org/Krukov/amocrm_api.svg?branch=master :target: https://travis-ci.org/Krukov/amocrm_api .. image:: https://img.shields.io/coveralls/Krukov/amocrm_api.svg :target: https://coveralls.io/r/Krukov/amocrm_api
Python AmoCRM API v2 (http://www.amocrm.ru/) (human interface for easy using)
::
pip install amocrm_api
Авторизация - с Июня 2020 amoCRM форсировала смену авторизации с токена на OAuth
И без поддержки server to server взаимодействия, в связи с чем текущая реализация содержит следующие ограничения
Example::
from amocrm.v2 import tokens
tokens.default_token_manager(
client_id="xxx-xxx-xxxx-xxxx-xxxxxxx",
client_secret="xxxx",
subdomain="subdomain",
redirect_url="https://xxxx/xx",
storage=tokens.FileTokensStorage(), # by default FileTokensStorage
)
tokens.default_token_manager.init(code="..very long code...", skip_error=True)
У каждой сущности есть менеджер (аттрибут objects), который имеет следующие методы
::
<Entity>.objects.get(object_id=1, query="test") # получение обьекта
<Entity>.objects.all() # получение всех сущностей
<Entity>.objects.filter(**kwargs) # получение списка сущностей с фильтром
<Entity>.objects.create(**kwargs) # создание сущности (нет явной сигнатуры поэтому лучше использовать метод create самой сущности)
<Entity>.objects.update(**kwargs) # обносление сущности (нет явной сигнатуры поэтому лучше использовать метод update самой сущности)
В свою очередь сама сущность имеет несколько методов для более простого создания и обновления
::
<EntityInstance>.create()
<EntityInstance>.update()
<EntityInstance>.save() # создаст или обновит в зависимости от того как обьект был инициализирован
Исключение - создание звонка происходит через упрошенную сущность ::
from amocrm.v2 import Call, CallDirection, CallStatus
Call().create(CallDirection.OUTBOUNT, phone="....", source="", duration=timedelta(minutes=10), status=CallStatus.CALL_LATER, created_by=manager)
Рассмотрим полный процесс работы на примере контакта
::
from amocrm.v2 import Contact, Company
contact = Contact.objects.get(query="Тест")
print(contact.first_name)
print(contact.company.name)
print(contact.created_at)
contact.last_name = "Новое"
contact.tags.append("new")
contact.notes.objects.create(text="Примечание")
contact.save()
contact.company = Company(name="Amocrm") # создаст и сразу прилинкует компанию
print(contact.company.id)
len(list(contact.customers)) # lazy list
contact.customers.append(Customer(name="Volta"))
Одна из удобных возможностей amoCRM - кастомные поля
Example::
from amocrm.v2 import Lead as _Lead, custom_field
class Lead(_Lead):
utm = custom_field.UrlCustomField("UTM метка")
delivery_type = custom_field.SelectCustomField("Способ доставки")
address = custom_field.TextCustomField("Адрес")
Однако мапинг всех кастомных полей дело утоминетльное, поэтому для генерации файла с готовым мапингом есть команда::
export AMOCRM_CLIENT_ID=xxx
export AMOCRM_SECRET=xxx
export AMOCRM_SUBDOMAIN=xxx
export AMOCRM_REDIRECT_URL=xxx
export AMOCRM_CODE=xxx # optional
pyamogen > models.py
Для ее работы необходимо установить пакет python-slugify (https://github.com/un33k/python-slugify)
FAQs
Python API for Amocrm
We found that amocrm-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.