python libs

Table of Contents

1. python libs

1.1. Web

1.1.1. django

1.1.2. flask

FastAPI Construido encima de flask para cuando sólo quieres hacer una api

1.1.3. javascript

1.1.4. Consumir APIs

1.2. Bases de datos

1.2.1. shilelagh: everything in SQL

shilelagh : Python library and CLI that allows you to query many resources (APIs, files, in memory objects) using SQL

1.2.2. pandasql : query pandas dataframes using SQLite

1.2.3. Asíncrono

  • aiomysql (MySQL)
  • aiopg (Postgres)
  • aioodbc
    (ODBC)
  • DuckDB Construido sobre Numpy y Pandas, trabaja a nivel de columnas en vez de registros individuales
  • piccolo-orm A fast, user friendly ORM and query builder which supports asyncio.
  • beanie Asynchronous Python ODM for MongoDB
  • asyncdb · PyPI Interfaz de alto nivel a:
    pg: AsyncPG (PostgreSQL)
    postgres: aiopg (PostgreSQL)
    mysql: aiomysql (mySQL)
    influx: influxdb (InfluxDB)
    redis: aioredis (Redis)
    mcache: aiomcache (Memcache)
    odbc: aiodbc (ODBC)

1.2.4. ETL de muchos datos

1.2.5. ORM

  • Prisma python client → Basado en un ORM escrito en Rust con soporte para Javascript, async opcional, type safe (por Rust)
    • No soporta de momento (2021-11-19) columnas de geometría postgis (2789 8417)

1.3. Generales

  • attrs Crea boilerplate para las clases (métodos dunder automáticamente)
  • imphook allows to easily define per file type import hooks, i.e. overload or extend import processing for particular file types, without affecting processing of other file types
  • apacheconfig pure-Python implementation of Apache-like configuration file parser into Python built-in types
  • plumbum Make bash scripts using python (example)
  • sh sh is a full-fledged subprocess replacement for Python 2.6 - 3.8, PyPy and PyPy3 that allows you to call any program as if it were a function

1.3.1. Asíncrono

  • uvloop asyncio event loop replacement in Cython
  • gunicorn → Hay links a librerías interesantes
  • ray → Funciona con Redis (aunque no por defecto) y tiene integraciones con Spark, Dask, MARS, Modin, Horovod, Hugging Face, Scikit-learn, …
  • aio-pool → Utilizar funciones asíncronas dentro de pools de Multiprocessing. Cuando tienes procesos que son a la vez intensivos en I/O y CPU

1.3.2. Análisis de código

  • pycodestyle pep8 Python style guide checker
  • https://flake8.pycqa.org/en/latest/flake8 Flake8: Your Tool For Style Guide Enforcement
  • wily A command-line application for tracking, reporting on complexity of Python tests and applications.
  • mypy análisis estático de código
  • pytype
    • It flags mistakes such as misspelled attribute names, incorrect function calls, etc. You can use pytype instead of pylint.
    • With a nod towards future compilation, pytype generates type annotations in pyi files. The resulting pyi files are merged back into the Python source with the merge-pyi tool.
  • PyRe PyRe (Python Reliability) is a python module for structural reliability analysis
  • pysa identifies potential security defects using taint analysis of input data.
  • codacy catches more errors and suspect code than pylint, including some of the stylistic warning we ignore → automate code review
  • loguru Better, more enjoyable logging than standard package

1.3.3. TRSTN4/br4nch: br4nch - Data Structure Tree Builder for Python.

1.4. GUIs

1.4.1. Automatización de GUI

  • pynput control the moment of external devices like a mouse and keyboard.
  • playsound, webbrowser para repoducir sonido, abrir webs

1.4.2. GUIs de pandas

1.5. Juegos

1.6. Tests y comprobación/validación

  • Faker
  • FactoryBoy
  • pydantic
  • runtype a collection of run-time type utilities for Python.
  • pandera pandera provides a flexible and expressive API for performing data validation on tidy (long-form) and wide data to make data processing pipelines more readable and robust. (check types also)
  • coverage

1.6.1. por ordenar

1.6.1.1. Generar dataframes falsos
  • Mismo problema de siempre, crear datos con bucles for es lento
  • pandas_faker
  • mimesis Mucho soporte de locales de otros países
  • Hypothesis genera arrays de numpy y dataframes, buena integración con las APIs de pandas
  • panderas Mejor integración con API de pandas que Hypothesis, puedes utilizar frictionless para especificar el schema

1.7. CLIs

  • Click Librería de CLIs
  • https://github.com/python-cmd2/cmd2 Librería de CLIs
  • xonsh terminal basada en Python
  • interfzf Para filtrar un iterable usando fzf
  • Austin TUI Interfaz declarativa usando xmls que usa ncurses por debajo
  • colorama Colores para la terminal
  • rich Rich text for the terminal
  • textual UI (Text User Interface) framework for Python inspired by modern web development, uses Rich
  • Python Prompt Toolkit vi/emacs text completionframework, pure python, async, with type annotations
  • urwid
  • asciimatics
  • pytermgui
  • pudb Debugger de Python con una interfaz por consola estilo años 80
  • asciipy Convert images and videos to ascii art and you can print them to the terminal or save them in image / video formats or in .txt file.
  • pyfiglet → crear ascii art a partir de texto

1.7.1. Barras y status de progreso

1.8. Android

1.9. Visualización

1.9.1. Dashboards/BI

1.9.2. Headless png maps

1.10. Audio/Música

  • librosa package for music and audio analysis
  • pyAudioAnalyis A Python library for audio feature extraction, classification, segmentation and applications

1.11. Data Science

1.11.2. Geocosas

  • geopy
  • kepler.gl Visualización en web (3d) en base a divisiones geográficas

1.11.3. Jupyter notebook

  • handcalcs Renderizar los cálculos de python como si los hicieses a mano en latex
  • papermill or nbclient → automate notebook execution

1.12. Machine Learning

1.12.2. Explainability

  • SHAP shap is a game theoretic approach to explain the output of any machine learning model. It connects optimal credit allocation with local explanations

1.14. Ciencia

  • Axelrod librería de investigación del dilema del prisionero
  • AgentPy - Agent-based modeling in Python
  • psi4 Química Cuántica
  • ProjectQ Computación cuántica
  • QuTiP Quantum Toolbox in Python, sobre todo óptica cuántica
  • https://github.com/quantum-visualizations/qmsolve%7Cqmsolve
    Visualizaciones de mecánica cuántica
  • stan Inferencia bayesiana y MCMC
  • celerite Scalable Gaussian Process (GP) Regression in one dimension
  • skfdiff ecuaciones en derivadas parciales por elementos finitos (siempre que no sean deformaciones de sólidos, etc. que en teoría están mejor en
    sfepy)
  • py-pde stochastic PDEs
  • findiff Calcula diferencias finitas a orden n
  • dipy spatial normalization, signal processing, machine learning, statistical analysis and visualization of medical images. Additionally, it contains specialized methods for computational anatomy including diffusion, perfusion and structural imaging. (neural stuff)

1.14.1. profiling

  • austin Zero instrumentation;Minimal impact;Fast and lightweight;Time and memory profiling;Built-in support for multi-process applications
  • perfplot Gráficas de tiempo en función de N: O(N), O(N^2), ..
  • Scalene a high-performance, high-precision CPU and memory profiler for Python
  • pyinstrument profiler for async code
1.14.1.1. bloomberg/memray: Memray is a memory profiler for Python

1.15. HTTP y Redes

1.15.1. JSON

  • JMESPAth Extraer datos de json con paths
  • simplejson más rápido que json pero compatible con él
  • Box Elementos de dict como atributos config.timeout, config.server.time.throttling recursivo
  • easydict Lo mismo que el anterior, menos estable

1.16. git

  • pre-commit checks antes de hacer un commit
  • GitPython python library used to interact with git repositories, high-level like git-porcelain, or low-level like git-plumbing.
  • pydriller Python framework that helps developers in analyzing Git repositories (higher level than gitpython)

1.17. pdfs

1.18. Sin clasificar

1.19. lenguajes naturales y fuzzy match / NLP

  • NLTK, Gensim
  • Levenshtein, thefuzz, spacy
  • Text Blob TextBlob stands on the giant shoulders of NLTK and pattern, and plays nicely with both. (medium tutorial)
  • gensim Latent semantic indexing
    (Singular value decomposition)
    • Efficient multicore implementations of popular algorithms, such as online Latent Semantic Analysis (LSA/LSI/SVD), Latent Dirichlet Allocation (LDA), Random Projections (RP), Hierarchical Dirichlet Process (HDP) or word2vec deep learning.
  • clavier
    Measure edit distance based on keyboard layout.

1.20. Las más conocidas

Author: Julian Lopez Carballal

Created: 2024-09-16 Mon 05:49