Saravanan666/pypi-org huggingface dataset:
Package: encoding_repair
It is alarming, that very often, special characters like umlauts break whenconverting through different encodings. (You might want to take a look at theGerman Amazon Marketplace.)A broken umlaut is still valid in the target encoding and therefore can only bedetect through heuristics (magic).Version 0.5: supporting utf-8 and latin1For a full changeset, take a look at bitbucket.org/niels_mfo/encoding_repair(bug reports will also be accepted there)A common case that breaks a special character is the following:- An input string is coded in utf-8 (which uses multibyte chars)- It is interpreted as being a valid latin1 string- Latin1 has a valid representation for nearly all bytes- Latin1 uses single-byte chars- Now both bytes of the multi-byte char are interpreted as chars- The special char broke off into two different (valid!) charactersThis scenario has many pitfalls:- The characters are irreversebly broken.- ... regardless of what you do with the string.- You can convert it through all encodings and the umlauts won't come back.- Only through a few heuristical replaces, this module is able to help you.This module assumes, that a few special characters are always correct. They arestored in the list 'umlauts'. Furthermore, the module assumes, that theirrepresentation, that would be correct in the other encoding, is always broken inthe target-encoding.NOTE:This only happens, because people don't use unicode. If everybody wouldconsequently use unicode strings, I would not have to write this module.The best and actually only way to handle encodings correctly is the following:- An input string comes into your programm.- If it is unicode, jump to point 6.- If it isn't, you might already need to repair umlauts.- You need to make sure, that you know the right encoding of the inputstring, because it is hardly possible to guess.- Convert it to unicode.- Use the unicode string throuout your whole programm.- If you can return unicode, return unicode.- If you are in doubt, return unicode.- If you really need to return anything else, return utf-8.- If you are certain, that the programm, which will take your output is notable to handle neither unicode nor utf-8, you better write a bug report.
Package: encoding-tools
Encoding ToolsThis module aims to provide a wrapper to deal with encoding in Python.FeaturesEncode str to bytesfromencoding_toolsimportTheSoCalledGreatEncoderencoder=TheSoCalledGreatEncoder()encoder.load_str('hellò')encoder.encode('latin-1')encoded_string=encoder.encoded_dataYes, this is a much complicated than a simple'hellò'.encode('latin-1'), but it deals with encoding errors.
By default, it will fallback to ASCII if an error is encountered.fromencoding_toolsimportTheSoCalledGreatEncoderencoder=TheSoCalledGreatEncoder()encoder.load_str('cœur')# œ is not supported by latin-1encoder.encode('latin-1')encoded_string=encoder.encoded_data# equals to b'coeur'If you want to force ASCII conversion, you can do it by specifyingforce_ascii=Truewhen
calling.encode().Decode bytes to strfromencoding_toolsimportTheSoCalledGreatEncoder,GuessEncodingFailedExceptionencoder=TheSoCalledGreatEncoder()encoder.load_bytes(b'hell\xf2')try:encoder.decode()exceptGuessEncodingFailedExceptionase:# Deal with itraiseValueError('Wrong input...')fromedecoded_string=encoder.decoded_data# equals to 'hellò'encoding=encoder.encoding# equals to 'ISO-8859-1'The decoder will guess encoding for you using the great Chardet library. You can as well provide the encoding
if you know when you load the data:.load_bytes(b'hell\xf2', encoding='latin-1')To change data encoding, proceed this way:fromencoding_toolsimportTheSoCalledGreatEncoder,GuessEncodingFailedExceptionencoder=TheSoCalledGreatEncoder()encoder.load_bytes(b'hell\xf2')# latin-1try:encoder.decode()exceptGuessEncodingFailedExceptionase:# Deal with itraiseValueError('Wrong input...')fromeencoder.encode('utf-8')encoded_string=encoder.encoded_data# equals to b'hell\xc3\xb2'encoding=encoder.encoding# equals to 'utf-8'RoadmapDeals with decoding errorsSupport more encoding (test suite)
Package: encolor
Encolorencoloris a simple tool that adds color to terminal output. To select which patterns to colorize, you can use simple, but extensible (complete support for Python regex) syntax.InstallationPre-builtYou can installencolorfromPyPIusingpip:pipinstallencolorCompileAlternatively, you can compile the project yourself.gitclonehttps://github.com/Froloket64/encolor.git--depth1~/encolor# You can change "~/encolor" to any other dirpipinstall~/encolorUsageYou can use the app from terminal:# Standaloneencolor-r"def: red, \(|\): gray"sub"def main():"# With a pipeecho"def main():"|encolor-r"def: red, \(|\): gray"subOr use the functions from within your Python code:fromencolorimportgfxprint(gfx.colorize_ansi("def main():","red"))You can see syntax specification on the Github Wiki page.For full documentation on module functionality, please refer to the source code (for now).
Package: encommon
Enasis Network Common LibraryCommon classes and functions used in various public and private projects forEnasis Network.Installing the packageInstalling stable from the PyPi repositorypip install encommonInstalling latest from GitHub repositorypip install git+https://github.com/enasisnetwork/encommonDocumentationDocumentation is onRead the Docs.
Should you venture into the sections below you will be able to use thesphinxrecipe to build documention in thedocs/htmldirectory.Quick start for local developmentStart by cloning the repository to your local machine.git clone https://github.com/enasisnetwork/encommon.gitSet up the Python virtual environments expected by the Makefile.make -s venv-createExecute the linters and testsThe comprehensive approach is to use thecheckrecipe. This will stop on
any failure that is encountered.make -s checkHowever you can run the linters in a non-blocking mode.make -s linters-passAnd finally run the various tests to validate the code and produce coverage
information found in thehtmlcovfolder in the root of the project.make -s pytestFuture features and subpackagesnetdomsubpackageThis package will include class objects for handling network addresses and
other functions to assist with validating and normalizing domain names.formatssubpackageThis package will include class objects to help with dealing with verious
formats of data. These formats will include Jinja2, CSV, and HTML.
Package: enconv
EnconvA light wrapper around chardet to conveniently convert text files.Install~$ pip install enconvUsageenconv: Guess and convert between encodingsusage:enconv[-h][-ieINPUT_ENCODING][-glGUESS_LENGTH][-oeOUTPUT_ENCODING][-ofOUTPUT_FILE][-ow]input_fileenportal: Guess and convert file encodings from source to destination foldersusage:enportal[-h][-ieINPUT_ENCODING][-glGUESS_LENGTH][-oeOUTPUT_ENCODING][-ow][-iINTERVAL]input_diroutput_direncheck: Guess text encoding of files in folderusage:encheck[-h][-glGUESS_LENGTH]input_dirExample~$enconv/Users/me/Downloads/chinese.txt
Guess:{'encoding':'GB2312','confidence':0.99,'language':'Chinese'}Wroteto/Users/me/Downloads/chinese.txt.utf-8inutf-8
Package: encor
This is an updated, maintained fork of theoriginal acorpackage. Below is the original README with the appropriate changes to the name and source locations.This is a direct port of a C++ routine byJonathan Goodman(NYU)
calledACORthat
estimates the autocorrelation time of time series data very quickly.Dan Foreman-Mackey(NYU) made a few surface changes to
the interface in order to write a Python wrapper (with the permission of the
original author).InstallationJust runpip install encorwithsudoif you really need it.Otherwise, download the source codeas a tarballor clone the git repository fromGitHub:git clone https://github.com/davecwright3/acor.gitThen runcd acor
python -m pip install .to compile and install the moduleacorin your Python path. The only
dependency isNumPy(including thepython-devandpython-numpy-devpackages which you might have to
install separately on some systems).UsageGiven some time seriesx, you can estimate the autocorrelation time
(tau) using:import acor
tau, mean, sigma = acor.acor(x)Referenceshttp://www.math.nyu.edu/faculty/goodman/software/acor/index.htmlhttp://www.stat.unc.edu/faculty/cji/Sokal.pdf
Package: encord
Encord Python API ClientThe data engine for computer vision💻 FeaturesMinimal low-level Python client that allows you to interact with Encord's APISupports Python:3.8,3.9,3.10and3.11✨ Relevant LinksEncord websiteEncord web appEncord documentation💡 Getting StartedFor full documentation, please visitEncord Python SDK.First, install Encord Python API Client using thepippackage manager:python3-mpipinstallencordThen, generate an public-private key pair, and upload the public key toEncord website.
Detailed guide can be found in thededicated manual.Passing the private key to the factory, you can initialise the Encord client directly.# Import dependenciesfromencordimportEncordUserClient# Authenticate with Encord using the path to your private key.  Replace <private_key_path> with the path to your private key.user_client=EncordUserClient.create_with_ssh_private_key(ssh_private_key_path="<private_key_path>")For detailed examples and API reference please refer toEncord SDK documentation🐛 TroubleshootingPlease report bugs to theGitHub Issues.
Just make sure you read theEncord documentationand search for related issues first.
Package: encore
This package consists of a collection of core utility packages useful for
building Python applications.  This package is intended to be at the
bottom of the software stack and have zero required external dependencies
aside from the Python Standard Library.PackagesEvents:A package implementing a lightweight application-wide Event dispatch system.  Listeners
can subscribe to events based on Event type or by filtering on event attributes.  Typical uses
include UI components listening to low-level progress notifications and change notification for
distributed resources.Storage:Abstract base classes and concrete implementations of a basic key-value storage API.
The API is intended to be general purpose enough to support a variety of local and remote storage
systems.Concurrent:A package of tools for handling concurrency within applications.Terminal:Some utilities for working with text-based terminal displays.PrerequisitesPython >= 3.6Sphinx, graphviz, sphinx_copybutton, enthought_sphinx_theme
(documentation build)Some optional modules have dependencies on:Requests (https://requests.readthedocs.io/en/latest/)
Package: encore_bigdata2
encore_bigdata2This package is for the practice of Encore MLOps and Bigdata education course in October 2023. The package consists of six different modules, each of which contains a single function. The following part of this document describes how to install, develope, test, and deploy the package, and instructions to run each functions.Install$pipinstallencore_bigdata2Dev.$gitclone...
$cdencore_bigdata2
$pdmvenvcreate
$source.venv/bin/activate(encore_bigdata-3.8)$pdminstallTest$pdmadd-dGtestpytestpytest-cov
$pytest
$pytest-s
$pytest--covDeploy$pdmpublishContributingInstructions for each moduleThis section refers to the instructions for each modules and their own functions.Remember, while the one can use these functions through importing the modules and functions in Python environment, you can also run these functions individually by the specific command which can be found in each section of functions.app_8trider.pyrandomMember()This function prints the name of randomly selected member of the group. There are six group members in this group.fromencore_bigdata2.app_8triderimportrandomMember$whosbuymenuRecommend()This function helps select a menu for lunch time. There are 13 menus in the menu list in the function, which includes "굶기"(it means"starve"in Korean...). May the God protect them...fromencore_bigdata2.app_8triderimportmenuRecommend$menuapp_doxgxxn.pycoin_game(num)The function for the game at drink party. As the user runs the function, it flips two coins. If the two coins show the tail samely, the user must drink the beverage as a penalty.Note: This function is not working properly yet, and probably will be fixed in near future.fromencore_bigdata2.app_doxgxxnimportcoin_game$coin_gameapp_felicette.pytoday_felicette()This function simply prints what day it is today. The units of the today's date is from year to microsecond.fromencore_bigdata2.app_felicetteimporttoday_felicette$today_datetimeapp_jiug.pyplay_card_game()The card game this function refers to is 'black jack'. If you are not familiar with the rules of black jack, the player who gets the score the nearest to the number 21 wins. If the player's score gets higher than 21, the player immediately lose the game. If the score is exactly 21, the player wins the game immediately. Or else, the players calculate the score based on the number on the cards they hold.fromencore_bigdata2.app_jiugimportplay_card_game$black_jackapp_tjkpolisher.pysamsung_price()This function prints the stock price of Samsung Electronics(stock code: 005930) in Korean stock market. As the stock market opens at 09:00 KST and closes at 15:30, when the user runs this code at the time when the market is still open, it continuously prints the changing price at the very current timestamp. Otherwise, the function will print the latest close price of the stock.fromencore_bigdata2.app_tjkpolisherimportsamsung_price$samsung_price
Package: encore-python
encore-pythonPython API wrapper for encore.usFeaturesMusic Search: Perform searches by track name, album, artist, genre, and year with both basic and advanced filtering options.Download Tracks: Download music tracks directly using the song identifier or aSongobject.Rate Limit Handling: Automatically handles API rate limits, providing feedback on the remaining number of queries and reset times.Flexible Search Queries: Supports both simple string queries and structured search objects (BasicSearchandAdvancedSearch).InstalationFrom pippipinstallencore-pythonFrom repositorygitclonehttps://github.com/joshrmcdaniel/encore-python.gitcdencore-python
pipinstall-e.UsageBasic SearchTo perform a basic search by track name, album, artist, genre, or year:fromencore_pythonimportEncoreAPIapi=EncoreAPI()# Basic search by track nameresponse=api.search("Track Name")Advanced SearchFor more complex queries involving multiple criteria:# Advanced search by artist with additional filtersresponse=api.search_by_artist("Artist Name",exact=True)Iterating search resultsThe ability to iterate through all results is avaiable with theiter_resultsargDownloading TracksDownloading tracks is available. Available options include: sng file, convert from the sng format to the directory format, and returning a buffer.To download a track:# With the hash as a sng fileapi.download("abcedf....")# With the song jsonsearch_res=api.search("Jeff")song=search_res.data[0]api.download(song)This will download a track into the current working directory with the filename of the download hash, with.sngDownloading a track and converting itsearch_res=api.search("Jeff")song=search_res.data[0]api.download(song,as_sng=False)Seesng-format-pythondocs for other sng conversion args.ContributingContributions to the encore-python are welcome.Licenseencore-python is released under the MIT License. See the LICENSE file in the repository for more details.
Package: encosy
encosyDocsInstallationUsing pipReleases ofencosycan be installed using pip::$ pip install encosySource releases and any binaries can be downloaded from the PyPI link.https://pypi.org/project/encosy/Using git and poetryFor poetry guide followthis link::git clone https://github.com/Cruxyu/encosy.git
poetry installProfilingCPUTo create a profile.proffrom file_with_app import app
import cProfile
import pstats


def main():
    with cProfile.Profile() as pr:
        app()
    stats = pstats.Stats(pr)
    stats.sort_stats(pstats.SortKey.TIME)
    # stats.print_stats()
    stats.dump_stats("app.prof")


if __name__ == "__main__":
    main()To see viz of a profilepoetry run python -m snakeviz app.profMemoryTo test memory runmprof run app.pyTo see the results runmprof plot
Package: encounter
SQL CheatsheetFind all the aicraft on a particular hour over Haight St, San Fran:.. code-block:: SQLselect * from state_vectors_data4 where hour=1480759200 and lat > 38.0000 and lat < 39.0000 and lon > -123.0000 and lon < -122.0000;Count all the timestamps in the same location but over about a week:.. code-block:: SQLSELECT COUNT(*) FROM state_vectors_data4 WHERE hour>=1598918400 AND hour<=1599523200  and lat > 38.0000 and lat < 39.0000 and lon > -123.0000 and lon < -122.0000;Count aircraft which arrived or departed or crossed Frankfurt airport during a certain hour:.. code-block:: SQLSELECT COUNT(DISTINCT icao24) FROM state_vectors_data4 WHERE lat<=50.07 AND lat>=49.98 AND lon<=8.62 AND lon>=8.48 AND hour=1493892000;
Package: encourage
encourageEncourage is a Python command line tool speaking encourage words to you for motivationsInstallationUse the package managerpipto install encouragepipinstallencourageUsageThe command for using encourage tool is 'e' ，add -h option for detailed manual readingeYou can edit the cnf file to do custom encouragementeg:nickname jack
repeat   you are a great guyThe encourage will speak 'jack , you are a great guy' to youeg:nickname jack
keep going  
you can make itThe encourage will speak 'jack , keep going'/'jack , you can make it 'When there is no nickname or no encourage words in the cnf , default nickname or encourage words will be used
Package: encpng
EncPNGA steganographic library to encrypt files and text in PNG images using CSPRNG random generated pixel colors, shuffled charset for pybase64, and AES-256 with tag (anti-tamper support, and with Intel-NI support on Intel processors) to encrypt or decrypt data (full UTF-8 support).USING LIBRARY ENCPNGfromencpngimportEncPNGenc=EncPNG("Ko n ni chi ka!","Password ][!")# Image passed as bytesimg=enc.encrypt()result=enc.decrypt(img)fromencpngimportEncPNGenc=EncPNG("Ko n ni chi ka!","Password ][!","/path/to/out")enc.encrypt()enc.decrypt("08a30930-ecdf-4f6a-9978-c274093d63e1.png","Password ][!","/path/to/file")
Package: encpoly
Theencpolypackage is a Python 3 library for fast, Pythonic manipulation ofencoded polylines.>>>fromencpolyimportencode,decode>>>coords=((38.5,-120.2),(40.7,-120.95),(43.252,-126.453))>>>encode(coords)'_p~iF~ps|U_ulLnnqC_mqNvxq`@'>>>tuple(decode("_p~iF~ps|U_ulLnnqC_mqNvxq`@"))([38.5,-120.2],[40.7,-120.95],[43.252,-126.453])You can use Pip to install thelatest releasefrom PyPi:pip install encpoly
Package: encrusted
encrustedThe project was developed using thematurinframework.InstallationFrom PyPI:pipinstallencrustedBuild from source:maturin build -r -i=path/to/python
pip install .../encrusted/target/wheels/<whl file name>.whlUsageimportnumpyasnpimportencrustedarr=np.random.randint(0,1,size=(100,100))encoded_arr=encrusted.encode(arr)assertnp.array_equal(encrusted.decode(encoded_arr),arr)Running TestsTests are run withpytest.
Package: encrypt-config
Encrypt ConfigEncrypt and decrypt information in configuration files.I find my self using json and ini files to store user credentials for
temporary use.Currently just supporting JSON files.Free software: Apache Software License 2.0Documentation:https://encrypt-config.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2021-09-18)First release on PyPI.
Package: encrypt-decrypt-fields
ORM Encrypt Decrypt FieldsA Django and SQLAlchemy model field that encrypts your data based SHA256 algorithm and Fernet (symmetric encryption)
when saving to the model field. The fernet module guarantees that data encrypted using it cannot be further manipulated
or read without the key. It keeps data always encrypted in the database.Also, possible to use it directly with the Crypto class.How installpip install encrypt-decrypt-fieldsUsageFor Django use project secret key or own:fromdjango.dbimportmodelsfromencrypt_decrypt_fieldsimportEncryptedBinaryFieldclassDemoModel(models.Model):password=EncryptedBinaryField(blank=True,null=True)from.modelsimportDemoModelDemoModel.objects.create(password='password')demo=DemoModel.objects.get(id=1)print(demo.password.to_bytes())# b'gAAAAABgxGVVeTPV9i1nPNl91Ss4XVH0rD6eJCgOWIOeRwtagp12gBJg9DL_HXODTDW0WKsqc8Z9vsuHUiAr3qQVE9YQmTd3pg=='To read bytes in postgres, use to_bytes() method of memoryviewobj.password.to_bytes()orbytes(obj.password, 'utf-8')To decrypt value use Crypto class:fromdjango.confimportsettingsfromencrypt_decrypt_fieldsimportCryptofrom.modelsimportDemoModelobj=DemoModel.objects.get(id=1)decrypted=Crypto(settings.SECRET_KEY).decrypt_token(obj.password.to_bytes())print(decrypted)# 'password'For SQLAlchemy, it is similar:fromsqlalchemyimportColumn,Integer,Stringfromsqlalchemyimportcreate_enginefromsqlalchemy.ormimportdeclarative_base,sessionmakerfromencrypt_decrypt_fieldsimportCrypto,EncryptedAlchemyBinaryFieldBase=declarative_base()engine=create_engine("sqlite:///:memory:",echo=True)classDemo(Base):__tablename__='demo'id=Column(Integer,primary_key=True)name=Column(String)password=Column(EncryptedAlchemyBinaryField(key='secret'),nullable=True)Session=sessionmaker(bind=engine)session=Session()demo=session.query(Demo).first()Crypto('secret').decrypt_token(demo.password)
Package: encrypted-bucket
CDK Construct: Encrypted S3 BucketsExample for a polyglot CDK construct created withjsiiandprojenfor encrypted S3 Buckets.NPM PackageNuGet PackagePyPi PackageUsageimport{EncryptedBucket}from'encrypted-buckets';newEncryptedBucket(stack,'EncryptedBucket',{versioned:true,});Further Readingsuperluminar.iofor a detailed guide in GermanLicenseFeel free to use the code, it's released using theMIT license.ContributionYou are welcome to contribute to this project! 😘To make sure you have a pleasant experience, please read thecode of conduct. It outlines core values and beliefs and will make working together a happier experience.
Package: encrypted-config
Library and command-line tool for reading and writing of partially encrypted configuration files.ContentsHow to useHow to NOT useAlgorithmsRequirementsHow to useimportencrypted_configHow to NOT useRunning this library on an system to which anyone else has access is not secure.If anyone else can access your private key, they can also decrypt the configuration.AlgorithmsThe library relies on RSA.RequirementsPython version 3.4 or later.Python libraries as specified inrequirements.txt.Building and running tests additionally requires packages listed intest_requirements.txt.Tested on Linux, OS X and Windows.