Skip to content

Instantly share code, notes, and snippets.

@bekirbakar
Created April 19, 2023 12:00
Show Gist options
  • Save bekirbakar/0584152cd6b5e7873933e4cde252edf0 to your computer and use it in GitHub Desktop.
Save bekirbakar/0584152cd6b5e7873933e4cde252edf0 to your computer and use it in GitHub Desktop.
Python Notes

Python Notes

Standalone Python Distribution - Portable Python

  • PyOxidizer

  • PyInstaller

  • Without a Package

    • Create Python Executable
    • Pack Wheel Files
    • Re-arrange Pip Path and Install Packages

Interpreter Modes

  • Interactive
  • Script Mode

Special Attributes and Methods

all : Lists public objects of a module. author : Module information. slots : Fast way to access attributes, space-saving. Explicitly state which instance attributes you expect your objects to have. repr : Represent a class object as a string. del / delete : Deconstruction super : Builtin

  • lru_cache: Least Recently Used (Discards the Least)

OOP Concepts

  • Multiple Inheritance
  • Method Order Resolution (MRO)

Decorators

A decorator is a function that takes another function as its argument and returns yet another function.

Examples include:

  • Getter
  • Setter
  • Delete
  • Property

NLP Libraries

Package Description
NLTK Natural Language Toolkit (NLTK) is a library for working with human language data, including tokenization, parsing, and sentiment analysis.
spaCy spaCy is an industrial-strength natural language processing (NLP) library, providing capabilities for named entity recognition, part-of-speech tagging, and more.
xml xml is a Python library for working with XML data.
evaluate evaluate is a library for evaluating machine learning models.
inflect inflect is a library for pluralizing and singularizing words in English.
jiwer jiwer is a library for computing Word Error Rate (WER) and other speech recognition metrics.
num2words num2words is a library for converting numbers to their written English representation.
pandas pandas is a library for working with tabular data in Python.
phonetisaurus Phonetisaurus is a library for performing grapheme-to-phoneme (G2P) conversion, which is the process of converting written text to its pronunciation.
pysrt pysrt is a library for working with SubRip subtitle files.
wordcloud wordcloud is a library for generating word clouds from text data.
xmltodict xmltodict is a library for converting XML data to Python dictionaries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment