Saravanan666/pypi-org huggingface dataset:
Package: fars-cleaner
FARS Cleanerfars_cleanerfars-cleaneris a Python library for downloading and pre-processing data
from the Fatality Analysis Reporting System, collected annually by NHTSA since
1975.InstallationThe preferred installation method is throughconda.condainstall-cconda-forgefars_cleanerYou can also install withpip.pipinstallfars-cleanerUsageDownloading FARS dataTheFARSFetcherclass provides an interface to download and unzip selected years from the NHTSA FARS FTP server.
The class usespoochto download and unzip the selected files. By default, files are unzipped to your OS's cache directory.fromfars_cleanerimportFARSFetcher# Prepare for FARS file download, using the OS cache directory.fetcher=FARSFetcher()Suggested usage is to download files to a data directory in your current project directory.
Passingproject_dirwill download files toproject_dir/data/farsby default. This behavior can be
overridden by settingcache_pathas well. Settingcache_pathalone provides a direct path to the directory
you want to download files into.frompathlibimportPathfromfars_cleanerimportFARSFetcherSOME_PATH=Path("/YOUR/PROJECT/PATH")# Prepare to download to /YOUR/PROJECT/PATH/data/fars# This is the recommended usage.fetcher=FARSFetcher(project_dir=SOME_PATH)# Prepare to download to /YOUR/PROJECT/PATH/farscache_path="fars"fetcher=FARSFetcher(project_dir=SOME_PATH,cache_path=cache_path)cache_path=Path("/SOME/TARGET/DIRECTORY")# Prepare to download directly to a specific directory.fetcher=FARSFetcher(cache_path=cache_path)Files can be downloaded in their entirety (data from 1975-2018), as a single year, or across a specified year range.
Downloading all of the data can be quite time consuming. The download will simultaneously unzip the folders, and delete
the zip files. Each zipped file will be unzipped and saved in a folder{YEAR}.unzip# Fetch all datafetcher.fetch_all()# Fetch a single yearfetcher.fetch_single(1984)# Fetch data in a year range (inclusive).fetcher.fetch_subset(1999,2007)Processing FARS dataCallingload_pipelinewill allow for full loading and pre-processing of the FARS data requested by the user.fromfars_cleanerimportFARSFetcher,load_pipelinefetcher=FARSFetcher(project_dir=SOME_PATH)vehicles,accidents,people=load_pipeline(fetcher=fetcher,first_run=True,target_folder=SOME_PATH)Callingload_basicallows for simple loading of the FARS data for a single year, with no preprocessing. Files must
be prefetched using aFARSFetcheror similar method. Amapperdictionary must be provided to identify what, if
any, columns require renaming.fromfars_cleaner.data_loaderimportload_basicvehicles,accidents,people=load_basic(year=1975,data_dir=SOME_PATH,mapping=mappings)RequirementsDownloading and processing the full FARS dataset currently runs out of memory on Windows machines with only 16GB RAM. It is recommended to have at least 32GB RAM on Windows systems. macOS and Linux run with no issues on 16GB systems.ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. SeeCONTRIBUTING.mdfor more details.LicenseBSD-3 Clause
Package: farsi-tools
Farsi Tools: tools for processing Farsi (Persian) textTested with:Python 3.5+Use the following command to install using pip:pip install farsi-toolsUsage exampleConverting digitsUsereplace_arabic_digits_with_farsimethod to replace arabic digits with farsi digits.fromfarsi_toolsimportreplace_arabic_digits_with_farsireplace_arabic_digits_with_farsi('٤')# returns ۴Usereplace_ascii_digits_with_farsimethod to replace ASCII digits with farsi digits.fromfarsi_toolsimportreplace_ascii_digits_with_farsireplace_ascii_digits_with_farsi('4')# returns ۴Usereplace_farsi_digits_with_asciimethod to replace farsi digits with ASCII digits.fromfarsi_toolsimportreplace_farsi_digits_with_asciireplace_farsi_digits_with_ascii('۴')# returns 4Usereplace_arabic_digits_with_asciimethod to replace farsi digits with ASCII digits.fromfarsi_toolsimportreplace_arabic_digits_with_asciireplace_arabic_digits_with_ascii('٤')# returns 4Convert text to Farsi (Persian)Usestandardize_persian_textmethod to convert characters to standard persian formfromfarsi_toolsimportstandardize_persian_textstandardize_persian_text('سلام خوبي؟ کمك ﻧميخواي؟')# returns "سلام خوبی؟ کمک نمیخوای؟"Get Farsi (Persian) stop-wordsUsestopwordsmethod to retrieve list of persian stop-wordsfromfarsi_toolsimportstop_wordsstop_words()
Package: farstail
FarsTail: A Persian Natural Language Inference DatasetNatural Language Inference (NLI), also called Textual Entailment, is an important task in NLP with the goal of determining the inference relationship between a premise p and a hypothesis h. It is a three-class problem, where each pair (p, h) is assigned to one of these classes: "ENTAILMENT" if the hypothesis can be inferred from the premise, "CONTRADICTION" if the hypothesis contradicts the premise, and "NEUTRAL" if none of the above holds.There are large datasets such as SNLI, MNLI, and SciTail for NLI in English, but there are few datasets for poor-data languages like Persian.Persian (Farsi) language is a pluricentric language spoken by around 110 million people in countries like Iran, Afghanistan, and Tajikistan. Here, we present the first relatively large-scale Persian dataset for NLI task, called FarsTail. A total of 10,367 samples are generated from a collection of 3,539 multiple-choice questions. The train, validation, and test portions include 7,266, 1,537, and 1,564 instances, respectively.Getting started with packageWe have provided an API in the form of a python package to read and use FarsTail easier for persian and non-persian language researchers. In the following, we will explain how to use this package.You'll need Python 3.6 or higher.Installationpip install farstailusingLoading the original FarsTail dataset.fromfarstail.datasetsimportfarstailtrain_data,val_data,test_data=farstail.load_original_data()Loading the indexed FarsTail dataset.fromfarstail.datasetsimportfarstailtrain_ind,val_ind,test_ind,dictionary=farstail.load_indexed_data()
Package: farthing
Farthing will run arbitrary Python code while tracing the argument and return
types of all functions within a given file or directory. Farthing can then
automatically add type annotations based on the types of the values it saw
during the execution run. This might be useful if you want to add static types
to existing Python code, or for exploring codebases where you’re not sure what
type a value has.For instance, the following code:deffactorial(n):result=1foriinrange(2,n+1):result*=ireturnresultcan be automatically transformed into:deffactorial(n:int)->int:result=1foriinrange(2,n+1):result*=ireturnresultby running Farthing against the following test file:fromnose.toolsimportassert_equalimportfactdeftest_fib():test_cases=[(0,1),(1,1),(2,2),(3,6),(4,24),(5,120),]forindex,valueintest_cases:yield_check_fact,index,valuedef_check_fact(index,value):assert_equal(value,fact.factorial(index))UsageFarthing can be called from the command line. The first argument should be the
file or directory that should have type annotations added to it. The other
arguments should be the Python script to run with any arguments. For instance:farthingdemo/fact.py_virtualenv/bin/nosetestsdemo/tests.pyDemoTo run the demo, you can just rundemo.sh. To explain what it actually does:Runmake bootstrapto set up the virtualenv with dependencies.Run. _virtualenv/bin/activateto enter the virtualenv.Runfarthing demo/fact.py _virtualenv/bin/nosetests demo/tests.pyto
run_virtualenv/bin/nosetests demo/tests.pyand add annotations todemo/fact.pybased on the types of actual values used in the execution run.LimitationsAt the moment, Farthing is just a quick prototype, so currently has the
following limitations:Annotations are added just using the name of the type, which may not be
available in the current scope.Type annotations cannot be added to the Python script being run.The first type seen is used, rather than any attempt at finding a super-type.I’d be interested to see any projects along similar lines, so if you know of any,
I’d be grateful if you let me know.
Package: fa-scraper
filmAffinity to Letterboxd(Versión en español)Generates CSV file compatible withLetterboxd diary importerfrom
FilmAffinity user's data given their ID.This program is intended for personal use only; please ensure the person you
are getting the data from consents to it beforehand and check which privacy and
data protection regulations might apply before using the program to get data
from other people.InstallationUsingpipYou can installfa-scraperusingpip(Python 3.5+):python3-mpipinstallfa-scraperThen runfa-scraper[--csvFILE][--langLANG]idUsing DockerYou need to install Docker. Once installed, run:dockerrun--namefa-containerfascraperdev/fascraperfa-scraperid
dockercpfa-container:/*.csv.
dockerrmfa-container`Getting your IDsIn order to get your FilmAffinity data you need to find out what your
FilmAffinity ID is. There are different IDs for your user ratings and your
lists.How to get your user idGo to your profile page and copy theuser_idfield from the URL:filmaffinity.com/es/userratings.php?user_id=XXXXXXHow to get a list idGo to the list pages (in the left menu), and access the list you want (it needs
to be public).You need to copy thelist_idfield from the URL:filmaffinity.com/es/mylist.php?list_id=XXXXXXOptions--list LISTsets ID of the public list you want to export--csv FILEsets CSV export file name toFILE--lang LANGsets language toLANG. Letterboxd importer works best in
English, the default option.Runfa-scraper --helpto see further options.
Package: fa-scrapper
filmAffinity to Letterboxd(Versión en español)Generates CSV file compatible withLetterboxd diary importerfrom
FilmAffinity user's data given their ID.This program is intended for personal use only; please ensure the person you
are getting the data from consents to it beforehand and check which privacy and
data protection regulations might apply before using the program to get data
from other people.InstallationUsingpipYou can installfa-scrapperusingpip(Python 3.5+):python3-mpipinstallfa-scrapperThen runfa-scrapper[--csvFILE][--langLANG]idUsing DockerYou need to install Docker. Once installed, run:dockerrun--namefa-containerfascrapperdev/fascrapperfa-scrapperid
dockercpfa-container:/*.csv.
dockerrmfa-container`Getting your IDsIn order to get your FilmAffinity data you need to find out what your
FilmAffinity ID is. There are different IDs for your user ratings and your
lists.How to get your user idGo to your profile page and copy theuser_idfield from the URL:filmaffinity.com/es/userratings.php?user_id=XXXXXXHow to get a list idGo to the list pages (in the left menu), and access the list you want (it needs
to be public).You need to copy thelist_idfield from the URL:filmaffinity.com/es/mylist.php?list_id=XXXXXXOptions--list LISTsets ID of the public list you want to export--csv FILEsets CSV export file name toFILE--lang LANGsets language toLANG. Letterboxd importer works best in
English, the default option.Runfa-scrapper --helpto see further options.
Package: fasdr
FASDR: Fast and Simple Dense Retrieval🚧 WORK IN PROGRESS 🚧FASDR is a simple and lightweight library for fast and efficient document retrieval. It is designed to be easy to setup and use, built on top of popular, trusted components (scipy,spacy,transformers) to ensure it can be seamlessly integrated into existing projects and "just work". It's especially well suited for small-to-medium corpora, such as retrieval-augmented prompting of FOSS documentation.FeaturesFast and efficient dense retrieval using KDTree data structures.Simple interface for indexing and searching documents and sentences.Support for various file formats and customizable indexing options.Integration with the SpaCy and Sentence-BERT libraries for natural language processing and sentence embeddings.InstallationFirst, installfasdrvia pip:pip install fasdrNext, download sentence tokenization language model for
spacy:python -m spacy download en_core_web_trfQuick StartIndexing documentsQuick StartTo get started with FASDR, you can create aDocumentIndexobject by passing in the root directory containing the documents you want to index:fromfasdrimportDocumentIndexindex=DocumentIndex("/path/to/documents")Once you have created the DocumentIndex object, you can search for documents or sentences using the search_documents and search_sentences methods:# Find the top five documents relevant to the query "climate change"results=index.search_documents("climate change",k=5)# Find the top 10 sentences after filtering on the top 5 documentsresults=index.search_sentences_targeted("climate change",n_docs=5,n_sents=10)You can customize the behavior of the DocumentIndex object by specifying options such as the model name and the file extensions to include in the index:index=DocumentIndex("/path/to/documents",model_name="all-MiniLM-L6-v2",extensions=[".txt",".md",".pdf"])DesignFASDR is designed to be fast and simple, with a focus on ease of use and minimal setup. It uses FAISS for similarity search, which is a highly optimized library for dense vector search, and SpaCy with the Sentence-BERT component for embedding text. The library is built around two main classes:Document: Represents a single document and its embeddings.DocumentIndex: Represents an index of documents and their embeddings.Documentobjects are created by passing in the path to the document file, and can be used to search for similar sentences within the document.DocumentIndexobjects are created by passing in the root directory containing the documents to index, and can be used to search for similar documents or sentences across all the indexed documents.
Package: faselunar
libreria calculadora de fases lunaresUna pequeña librería que muestra el estado de la fase lunarInstallationpip install calculadora-fase-lunar==0.1.0ComencemosfromfaseLunar.faselunarimportFaseLunar# Instancia un objeto de la clase FaseLunarf=FaseLunar(19,3,1992)# llama al método calcular fase de la lunaprint(f.calcular_fase())# llama al método calcular luz de la fase lunarprint(f.obtener_luz())# llama al método emoji luna que muestra un emoji con la fase de la lunaf.emoji_luna()
Package: fashionable
fashionableDecorate your project with some fashionable supermodels.Decorator examplefromtypingimportSetfromfashionableimportfashionable@fashionabledefbits_to_binary_like(bits:Set[int],length:int=8)->int:bits.add(0)return''.join(str(int(binbits))forbinrange(length,0,-1))bits_to_binary_like('334455')# 11100Model examplefromtypingimportList,OptionalfromfashionableimportAttribute,ModelclassProject(Model):id=Attribute(str,max=32)name=Attribute(str)organization=Attribute(Optional[str])domain=Attribute(Optional[str])links=Attribute(Optional[List[str]])project=Project(1,'Test')Supermodel example with SanicfromtypingimportList,OptionalfromfashionableimportAttribute,SupermodelfromsanicimportSanicfromsanic.responseimportjson,HTTPResponseapp=Sanic()app.db=...classProject(Supermodel):_ttl=300id=Attribute(str,max=32)name=Attribute(str)organization=Attribute(Optional[str])domain=Attribute(Optional[str])links=Attribute(Optional[List[str]])@staticmethodasyncdef_create(raw:dict):awaitapp.db.project_create(raw)@staticmethodasyncdef_get(id_:str)->Optional[dict]:returnawaitapp.db.project_get(id_)@staticmethodasyncdef_update(id_:str,raw:dict):awaitapp.db.project_update(id_,raw)@staticmethodasyncdef_delete(id_:str):awaitapp.db.project_delete(id_)@app.get('/project/<id_>')asyncdefproject_get(request,id_):project=awaitProject.get(id_)returnjson(project)@app.post('/project')asyncdefproject_create(request):project=awaitProject.create(**request.json)returnjson(project,status=201,headers={'Location':'/project/'+project.id},)@app.put('/project/<id_>')asyncdefproject_update(request,id_):project=awaitProject.get(id_,fresh=True)awaitproject.update(**request.json)returnjson(project)@app.delete('/project/<id_>')asyncdefproject_delete(request,id_):project=awaitProject.get(id_,fresh=True)awaitproject.delete()returnHTTPResponse(status=204)if__name__=='__main__':app.run(host='0.0.0.0',port=8000)
Package: fashionpedia
Fashionpedia is a new dataset which consists of two parts:  (1) an ontology built by fashion experts containing 27 main apparel categories, 19 apparel parts, 294 fine-grained attributes and their relationships; (2) a dataset with 48k everyday and celebrity event fashion images annotated with segmentation masks and their associated per-mask fine-grained attributes, built upon the Fashionpedia ontology. Fashionpedia API enables reading, and visualizing annotations, and evaluating results.
Package: fashionsearch
Real Python Feed ReaderThe Real Python Feed Reader is a basicweb feedreader that can download the latest Real Python tutorials from theReal Python feed.For more information see the tutorialHow to Publish an Open-Source Python Package to PyPIon Real Python.InstallationYou can install the Real Python Feed Reader fromPyPI:python -m pip install realpython-readerThe reader is supported on Python 3.7 and above. Older versions of Python, including Python 2.7, are supported by version 1.0.0 of the reader.How to useThe Real Python Feed Reader is a command line application, namedrealpython. To see a list of thelatest Real Python tutorials, call the program without any arguments:$ realpython
The latest tutorials from Real Python (https://realpython.com/)
 0 How to Publish an Open-Source Python Package to PyPI
 1 Python "while" Loops (Indefinite Iteration)
 2 Writing Comments in Python (Guide)
 3 Setting Up Python for Machine Learning on Windows
 4 Python Community Interview With Michael Kennedy
 5 Practical Text Classification With Python and Keras
 6 Getting Started With Testing in Python
 7 Python, Boto3, and AWS S3: Demystified
 8 Python's range() Function (Guide)
 9 Python Community Interview With Mike Grouchy
10 How to Round Numbers in Python
11 Building and Documenting Python REST APIs With Flask and Connexion – Part 2
12 Splitting, Concatenating, and Joining Strings in Python
13 Image Segmentation Using Color Spaces in OpenCV + Python
14 Python Community Interview With Mahdi Yusuf
15 Absolute vs Relative Imports in Python
16 Top 10 Must-Watch PyCon Talks
17 Logging in Python
18 The Best Python Books
19 Conditional Statements in PythonTo read one particular tutorial, call the program with the numerical ID of the tutorial as a parameter:$ realpython 0
# How to Publish an Open-Source Python Package to PyPI

Python is famous for coming with batteries included. Sophisticated
capabilities are available in the standard library. You can find modules for
working with sockets, parsing CSV, JSON, and XML files, and working with
files and file paths.

However great the packages included with Python are, there are many
fantastic projects available outside the standard library. These are most
often hosted at the Python Packaging Index (PyPI), historically known as the
Cheese Shop. At PyPI, you can find everything from Hello World to advanced
deep learning libraries.

[... The full text of the article ...]You can also call the Real Python Feed Reader in your own Python code, by importing from thereaderpackage:>>> from reader import feed
>>> feed.get_titles()
['How to Publish an Open-Source Python Package to PyPI', ...]
Package: fa-signal-provider
fa-signal-providerA model library for all signal providers of Freya Alpha using python. It includes models to handle signal ingestion, signal status reports, profit and performance reports, etc.SponsorsFreya Alpha,
The Kára System,
Spark & Hale Robotic IndustriesGeneralRun and compiled for Python 3.9.13.
Expected to run for Python 3+DevelopmentTestingrun tests withpytest -s -vvto see all the details. This is extremely important for the library. It could make multiple pods fail.Installation as Consuming DeveloperSimply run:pip install fa-signal-providerImport in modules without the dash (e.g.):from fasignalprovider.trading_signal import TradingSignalSetup as ContributorCreate the virtul environment:py -m venv .venvStart the Environment:./.venv/Scripts/activate(or allow VS Code to start it). Usedeactivateto stop it.Upgrade the PIP.python -m pip install --upgrade pipAll the required libraries must be listed in requirements.txt and installed bypython -m pip install -r .\requirements.txtFor Dev usepython -m pip install -r .\requirements-dev.txtTo cleanup the environment run:pip3 freeze > to-uninstall.txtand thenpip3 uninstall -y -r to-uninstall.txtorpip3 install pip-autoremoveBuild LibraryPrerequisite: make sure that you give your Operating System user the right to modify files in the python directory. The directory where pyhton is installed.
Usepython setup.py bdist_wheelto create the dist, build and .eggs folder.Reference from a different projectIn order to use your own version of the project - to maybe contribute to the library - simply clone the code from github into new directory. Then add the path of that new directory to the requirements.txt file of your project. Then change in fa-signal-provider whatever you recommend to improve. Don't forget the Open-Closed Principle: extend only (unless it requires a breaking change)Releasing a new versionSimply commit and push into MAIN. Make sure you have tested well.Github Actions (.github/workflows/testing_and_deployment.yml) will deploy the file to pypi.org.Manual and old processDelete any old files in the /dist and build folder of your local environment.
Update your pip:python -m pip install --upgrade pipInstall the tools build, twine and bumpver:python -m pip install build twine bumpverUpgrade the setuptools:pip install --upgrade setuptoolsBump the version in pyproject.toml:bumpver update --patchThis will commit a new version to GitHub.Build the project:python -m buildCheck the distribution:twine check dist/*Upload to test-pypi to validate:twine upload -r testpypi dist/*Login with username: (password should be known)If the test-upload was successful, finally, upload to pypi production:twine upload dist/*Done.(P.S. Do not forget to update the library in your projects:pip install --upgrade fa-signal-provider)bumpver update --patch
Package: f-ask
Flask is a lightweightWSGIweb application framework. It is designed
to make getting started quick and easy, with the ability to scale up to
complex applications. It began as a simple wrapper aroundWerkzeugandJinjaand has become one of the most popular Python web
application frameworks.Flask offers suggestions, but doesn’t enforce any dependencies or
project layout. It is up to the developer to choose the tools and
libraries they want to use. There are many extensions provided by the
community that make adding new functionality easy.InstallingInstall and update usingpip:pip install -U FlaskA Simple ExamplefromflaskimportFlaskapp=Flask(__name__)@app.route('/')defhello():return'Hello, World!'$ env FLASK_APP=hello.py flask run
 * Serving Flask app "hello"
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)ContributingFor guidance on setting up a development environment and how to make a
contribution to Flask, see thecontributing guidelines.DonateThe Pallets organization develops and supports Flask and the libraries
it uses. In order to grow the community of contributors and users, and
allow the maintainers to devote more time to the projects,please
donate today.LinksWebsite:https://www.palletsprojects.com/p/flask/Documentation:http://flask.pocoo.org/docs/License:BSDReleases:https://pypi.org/project/Flask/Code:https://github.com/pallets/flaskIssue tracker:https://github.com/pallets/flask/issuesTest status:Linux, Mac:https://travis-ci.org/pallets/flaskWindows:https://ci.appveyor.com/project/pallets/flaskTest coverage:https://codecov.io/gh/pallets/flask