Saravanan666/pypi-org huggingface dataset:
Package: zip3
Zip3Select a directory in your S3 bucket, generate a ZIP archive out of it, and save the ZIP on a destination of your choice in your S3 bucket.How it worksEverything is kept in memory throughout the whole process; no temporary files are createdA simple interface: callZip3.generate(input_directory, output_key)(whereinput_directoryis the directory in S3 that you want to ZIP, andoutput_keyis where you want the newly-generated ZIP to get saved) and you're good to go!How to use itimportboto3fromzip3importZip3# Set up connection to S3conn=boto3.resource("s3",region_name="eu-west-2")# Instantiate Zip3 with your S3 bucketZ3=Zip3(conn,s3_bucket=bucket_name)output_key="test_folder/archive2.zip"input_directory="test_folder"# Generate ZIP and save it on S3Z3.generate(input_directory,output_key)How to contributeCreate a PR with your changesCreate an Issue with something you would like from this library
Package: zipaccess
Patches functions [modules]:file+open, and os.path:exists+isfile
to enable accessing files inside zip archives using standard file functions.Package:http://pypi.python.org/pypi/zipaccessProject:https://github.com/iki/zipaccessIssues:https://github.com/iki/zipaccess/issuesUpdates:https://github.com/iki/zipaccess/commits/master.atomInstall viapip:pip install zipaccessInstall viaeasy_install:easy_install zipaccessSources viagit:git clonehttps://github.com/iki/zipaccessSources viahg-git:hg clonegit://github.com/iki/zipaccessUsageUse as a class. Do not instantiate it:class AnyZipAccess(zipaccess.ZipAccess):
    any_zip = True  # custom modifications here

AnyZipAccess.enable()Or use as a module:zipaccess.enable()
zipaccess.addzip('data.zip')Optionally, register zipaccess.ZipAccess as os.zipaccess:zipaccess.enable(register=True)so other modules can easily use:try:
    os.zipaccess.enable(locals())
except AttributeError:
    passNote onGoogle App Engine(GAE)On GAE, the __builtin__ module changes are not reflected, even in the local name space.To use zip access in any GAE module, you need to enable it for that module locals:try:
    import zipaccess
    zipaccess.enable(locals())
except ImportError:
    passAlternatively, only enable zip access locally, if it was already registered:try:
    os.zipaccess.enable(locals())
except AttributeError:
    passOr enable it for target modules externally:zipaccess.enable([
    'babel.core',
    'babel.localedata',
    'tipfy.template',
    'werkzeug.debug.tbtools',
    ])
# It imports all the modules though, which may be not what you want.
# If you know, how to hook on module import, let me kindly know.Note, that os.path.isfile and os.path.exists are patched globally. Even on GAE,
they apply for all modules of given instance. If some modules do support
zip files, they usually first check if regular file exists, and if not, they
split the path and check if the zipfile exists.
With zip access enabled, the regular file check will succeed, which is ok
as long as consequently used file() or open() functions are patched too.Example:The tipfy.debugger.get_loader() function checks if templates are located
in a regular directory or in a zip file (lib/dist.zipusually).
Then it returns tipfy.template.Loader or tipfy.template.ZipLoader accordingly.
With zipaccess enabled, the standard tipfy.template.Loader will be used,
and thereforezipaccess.enable('tipfy.template')is needed to make it work.Seehttps://github.com/moraes/tipfy/blob/master/tipfy/debugger/__init__.py#L26.
Package: zip-analyzer
zipAnalyzerA cli script to analyze zip archive.InstallationInstall the package with pippip install zip-analyzerUsageTypezipAnalyzer --helpto view the help.usage: zipAnalyzer FILE [OPTIONS]

A cli script to analyze zip archive.

optional arguments:
  -h, --help           show this help message and exit
  -c, --crack          Tries to crack the encryption by enumeration over a password list. Extracts the zip archive if the password was found.
  --passlist PASSLIST  Path to custom password listExample analyze zip file$zipAnalyzer invoice.zip
encrypted:           True

File Name                 Modified           Size
invoice.docm       2020-05-13 09:36:06       7080Example use password list$zipAnalyzer invoice.zip -c
[+] Try 41 passwords
[+] Password found: "777"
[+] Files extracted
Package: zipatopy
ZipatoPy: Zipato Python APIThe Python library to interact with Zipato smarthome controllers.Inspired byggruner.
Tested with Zipato Zipatile.Main features:list devices, endpoints, attributes and attribute valuesmanipulate virtual endpoints (create/get/set/delete)synchronization of Zipato controllerlocal and cloud modeno external dependencies (build-in Python libs only)logging and verbose debugTODO:integrate asHome AssistantsensorGetting StartedThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes.Python VersionPython 2.7
Python 3.6InstallationFrom PyPI repository:pip install --upgrade zipatopyFrom source:git clone https://github.com/goooroooX/ZipatoPy.gitTest runStart with includedsamples:change USERNAME and PASSWORD to your my.zipato.com account informationfor test1.py change also DEVICE, ENDPOINT and ATTRIBUTEpython test1.py
python test2.pyAPI initialization for a cloud mode:from zipatopy import ZipatoPy
api = ZipatoPy(USERNAME, PASSWORD, verbose=True)
print(api.get_devices())API initialization for a local mode:from zipatopy import ZipatoPy
api = ZipatoPy(USERNAME, PASSWORD, url='http://X.X.X.X:8080/zipato-web/v2/', verbose=True)
print(api.get_devices())NOTE: local mode is limited comparing to cloud mode, but you will still be able to get attribute values when requesting directly with UUID.AuthorDmitry Nikolaenya-code base-gooorooo.comLicenseThis project is licensed under the Apache 2.0 License - see theLICENSEfile for details.
Package: zipbiaschecker
zipbiascheckerOne challenge of assessing algorithmic racial bias is sometimes that the data are missing (not collected as part of sign-up forms, for example) or unavailable for privacy reasons. In these cases, zipcode-level bias is an indirect measure. We can go one step further by analyzing Census data that contain racial demographic data by zip code. This package helps run this indirect check by looking at the correlation between the algorithmic output and the percentage of Black, Hispanic, and Indigenous people in that zip code.InstallationThis package can be installed using the command below:pip install zipbiascheckerExampleIn this example, the data is taken from theIllinois Department of Public Health COVID statisticsas of 7/15/20. We will examine the correlation between the positive rate of testing by zip code vs. the demographics of the zip code to check the disparate impact of COVID on racial minorities.importpandasaspdfromzipbiascheckerimportzipbiascheckeraszbcdf=pd.read_csv('zipbiaschecker/data/example/2020_07_15_illinois_covid_data.csv')df['positive_rate']=df['Positive Cases']/df['Tested']print(df.shape)df.head()(646, 4)ZipTestedPositive Casespositive_rate06000219251300.06753216000494414060.04300426000547712550.05344836000741913830.09138646000846723800.081336To interpret the cell below, we see that the rate of positive cases has a positive correlation of about .278 with the proportion of Black people in the zip code, .585 with the proportion of Hispanic people in the zip code, and .108 with the proportion of Indigenous people in the zip code.zip_bias_checker=zbc.ZipBiasChecker()zip_bias_checker.check_bias(df,zip_col_name='Zip',target_col_name='positive_rate')1 row(s) could not be matched out of 646

percent_black         0.277773
percent_hispanic      0.585238
percent_indigenous    0.107945
Name: positive_rate, dtype: float64Documentation notebook for process to generate reference dataIn thenotebooksfolder, the process to map zip codes to demographic data is documented in a Jupyter notebook. To run the notebook, clone this repository to obtain the data used.
Package: zipbomb
zipbombCreate zipbombs using pythonBased onDavid Fifield's projectInstallationFrom PyPIpip3installzipbombFrom GitHubpip3installgit+https://github.com/donno2048/zipbombUsage$zipbomb-h
usage:zipbomb[-h][-oOUTPUT][-nNUM_FILES][-sCOMPRESSED_SIZE]Createazipbomb

optionalarguments:-h,--helpshowthishelpmessageandexit-oOUTPUT,--outputOUTPUToutputfile[default:bomb.zip]-nNUM_FILES,--num-filesNUM_FILESnumberoffilesinthezip[default:100]-sCOMPRESSED_SIZE,--compressed-sizeCOMPRESSED_SIZEcompressedsizeofeachfile(inKb)[default:1000]
Package: zipcodeignoresamethread
Simple package for dealing with zip codes in python. This is a fork from
the package zipcode (https://github.com/buckmaxwell/zipcode) created to ignore
checking if the sql object created is in the same thread as the current.Full documentation athttps://pythonhosted.org/zipcode>>> import zipcode
>>>
>>> myzip = zipcode.isequal('44102')
>>> myzip.state     #=> 'OH'
>>> myzip.city      #=> 'Cleveland'
>>>
>>> myzip.to_dict() #=>  {'zip_type': u'STANDARD', 'city': u'CLEVELAND', 'population': u'27699', 'zip': u'44102', 'yaxis': u'-0.74',     'location_text': u'Cleveland, OH', 'country': u'NA', 'notes': u'', 'lon': -81.67, 'tax_returns_filed': u'17409', 'state': u'OH', 'z    axis': u'0.66', 'location': u'NA-US-OH-CLEVELAND', 'xaxis': u'0.1', 'lat': 41.47, 'wages': u'408225500', 'decommisioned': u'FALSE',     '_LOCATION_TYPE': u'PRIMARY', 'world_region': u'NA'}
>>>
>>> #all keys in the dictionary can be fetched with dot notation.
>>>
>>> zipcode.islike('00') #=> list of Zip objects that begin with given prefix.
>>>
>>> cbus = (39.98, -82.98)
>>> zipcode.isinradius(cbus, 20) #=> list of all zip code objects within 20 miles of 'cbus'
Package: zip-code-radius
zip-code-radius===============:info: Generate minimum sets of zip codes, based on a radius, thatcan be used in a series of searches to cover the entire USAFeatures********* downloads an up-to-date reference set of US postal codes froma repository hosted on ``github.com``Installation------------.. code-block:: shellpip install zip-code-radiusUsage-----.. code-block:: pythonimport sysfrom zip_code_radius import solverradius = float(sys.argv[1])results = solver.solve(radius)print "radius: %d, zip-codes: %d" % (radius, len(results))Notes-----``zip-code-radius`` stores the US postal code data at your os temp dir (e.g. /tmp/).
Package: zipcodes-in
zipcodes-in✍ Description of the projectZipcodes-in is a Python library built for querying India zipcodes, post offices and particular state/UT. Py Package can be installed fromhere.📊 Data description and preparationData was extracted fromhereCleaned the data and extracted all the values for India (IN). Script can be foundhereFinally, the data was converted from CSV to JSON. The data can be foundhere📍 FunctionalitiesQuery if a zipcode matches or notList random zipcodesValidate of a zipcode exists or notList top N zipcodesList any random N zipcodesList all the zipcodes in the dataset (absolutely NOT recommended!)💻 Installation# Install the package>>>pipinstallzipcodes-inZipcodes-in supports Python 3.6+👩‍💻 Running Scripts>>>fromzipcode_scriptimportzipcode>>>print(zipcode)ZipcodeclasstovalidateandfetchdataofprovidedIndiazipcode>>># Zipcode matching>>>print(zipcode.matching('834001'))[{'zipcode':'834001','region':'Ranchi','state_ut':'Jharkhand','country':'India','latitude':'23.3505','longitude':'85.2927','post_office':'Argora.'}]# Print random zipcodes>>>print(zipcode.random()){'zipcode':'177601','region':'Hamirpur(HP)','state_ut':'Himachal Pradesh','country':'India','latitude':'31.7124','longitude':'76.4841','post_office':'Badhani'}>>># Print N random zipcodes>>>print(zipcode.listRandomN(3))[{'zipcode':'711410','region':'Howrah','state_ut':'West Bengal','country':'India','latitude':'22.526','longitude':'88.0676','post_office':'Paikpara'},{'zipcode':'585107','region':'Kalaburagi','state_ut':'Karnataka','country':'India','latitude':'17.2967','longitude':'76.6671','post_office':'Kalaburagi HCB'},{'zipcode':'688539','region':'Alappuzha','state_ut':'Kerala','country':'India','latitude':'9.7869','longitude':'76.3235','post_office':'Varanad'}]>>># Print top N zipcodes>>>print(zipcode.listTopN(2))[{'zipcode':'110001','region':'New Delhi','state_ut':'Delhi','country':'India','latitude':'28.6369','longitude':'77.2183','post_office':'New Delhi G.P.O.'},{'zipcode':'110002','region':'New Delhi','state_ut':'Delhi','country':'India','latitude':'28.6453','longitude':'77.2456','post_office':'Civic Centre'}]NOTE:Version1.0istestedonWindows10.## If you face any issue while running, please raise an issue on this repository⚠️ The zipcode data was last updated on:Jul. 27th, 2021⚠️Looking forward to make the project better? 🤔We are open to suggestions and ideas! Feel free to raise an issue and we shall get back to you super soon!📑 LICENSEMIT LICENSE
Package: zipcode-sv
Zip codes El SalvadorThis Python package scrapesthis webto get zip codes by municipality. It uses Requests with BeautifulSoup to extract that information, which is returned as a dict or JSON.Install 🛠️This package is inPIP, so you can install it as a dependency:pipinstallzipcode-svHow to use 🪐fromzipcode.departmentimportDepartment,EndpointYou have to importDepartment, which is the main class for scraping the zip codes.Endpointis an Enum with El Salvador's departments to select from which one you want to get their municipalities with their zip codes.# returns endpoint to extract data in web sourcemy_department=Endpoint.san_salvador.value# scrapes web source to get municipalities with its zip codessan_salvador_zipcodes=Department(my_department)# returs a dict with municipalities and its zip codessan_salvador_zipcodes.zip_codesYou must expect a dictionary like this.{"Aguilares":"01122","Apopa":"01123","Ayutuxtepeque":"01121","Delgado":"01118","Cuscatancingo":"01119","El Paisnal":"01124","Guazapa":"01125","Ilopango":"01117","Mejicanos":"01120","Nejapa":"01126","Panchimalco":"01127","Rosario de Mora":"01128","San Marcos":"01115","San Martín":"01129","San Salvador":"01101","Santiago Texacuangos":"01130","Santo Tomás":"01131","Soyapango":"01116","Tonacatepeque":"01132"," ":" ","Summary":"San Salvador es un departamento fundado en 1525 ubicado en la Zona Central de El Salvador. Posee 3 distritos y 19 municipios."}
Package: zipcodetw
This package lets you find ZIP code by address in Taiwan.The main features:Fast. It builds ZIP code index by tokenization.Gradual. It returns partial ZIP code rather than noting when address is not
detailed enoguh.Stand-alone. It depends on nothing.UsageFind ZIP code gradually:>>>importzipcodetw>>>zipcodetw.find('臺北市')u'1'>>>zipcodetw.find('臺北市信義區')u'110'>>>zipcodetw.find('臺北市信義區市府路')u'110'>>>zipcodetw.find('臺北市信義區市府路1號')u'11008'After v0.3, you even can find ZIP code like:>>>zipcodetw.find('松山區')u'105'>>>zipcodetw.find('秀山街')u''>>>zipcodetw.find('台北市秀山街')u'10042'InstallationIt is available on PyPI:$sudopipinstallzipcodetwJust install it and have fun. :)Build Index ManuallyIf you install it bypiporpython setup.py install, a ZIP code index
will be built automatically. But if you want to use it from source code, you
have to build an index manually:$python-mzipcodetw.builderDataThe ZIP code directory is provided by Chunghwa Post, and is available from:http://www.post.gov.tw/post/internet/Download/all_list.jsp?ID=2201#dl_txt_s_A0206Changelogv0.6.5Updated to the 3+3 v2102.01 data.Fixed a Python 3 bug, maybe.v0.6.2–0.6.4A black hole ate the logs.v0.6.1Fixed the py2 py3 compatibility. Thanks the contribution fromPoren ChiangandRyan.v0.6Updated the data to 2014/12.v0.5.7Fixed a rarely issue that causes IndexError.v0.5.6Reverted removing insignificant tokens introduced in v0.5.4.It now handles insignificant tokens; andredundant units in the finding logic (directory.find).Allowed number token ends without unit.Nowaddress.tokensis a list.v0.5.5Fixed a gradual matching issue causing some wrong results.v0.5.4Removed the token whose unit is insignificant automatically.v0.5.3Fixed and simplified the matching logic for address tail.Refined the index building logic.v0.5.2Fixed the issue while it was running in multi-threaded environment.Added a new argument,keep_alive, for theDirectoryclass.v0.5.1Refined the code slightly.v0.5It now builds a ZIP code index when you install it; sothe package size is 12.5x smaller.The internal API is better now.v0.4It now shipped with an index compiled in SQLite; soinitiation time is ~680x faster, i.e. ~30ms each import; andzipcodetw.findis ~1.9x slower, i.e. ~2ms each call; andhas bigger package size.All code was moved intozipcodetwpackage.zipcodetw.findnow returns unicode instead of string.v0.3It builds full index for middle tokens; andalso normalizes Chinese numerals now!zipcodetw.findis ~1.06x faster.But initiation time increases to ~1.7x.v0.2zipcodetw.findis 8x faster now!It has a better tokenizing logic; anda better matching logic for sub-number now.zipcodetw.find_zipcodeswas removed.Internal API was changed a lot.The tests are better now.
Package: zipcreator
zipcreatorA quick tool for creating a zipfile from a list of files and/or directories.Getting StartedDocumentationFind full documentation of the project here:https://zipcreator.readthedocs.ioInstallingpython setup.py installorpip install zipcreatorExamplefromzipcreatorimportlist_zipfiles=['test.txt','testdir/']dest='result.zip'list_zip.create(files,dest)Versioningv1.0.0 - Initial Release - 04/20/2020v1.0.1 - Added ability to pass in directory name only - 08/15/2020AuthorsMatt Palazzolo-GitHub ProfileLicenseThis project is licensed under the MIT License - see theLICENSE.txtfile for details
Package: zip-deploy
zip-deployProvides an easy way to fetch contents from a remote ZIP files and sync/extract them to a local destination dir.
Note that during download and extraction the contents will not be consistent.
Not thread-safe - so take care and check the documentation.
If you use the cli, check the -h option for configurable options.Installationpip install zip-deployUsageWindows CLI:# Executes the check every 15 seconds
zip-deploy.exe  --content-destination "./movies" --update-interval 15 "http://your-url.domain/movies.zip"Unix cli:# Executes the check every 15 seconds
zip-deploy  --content-destination "./movies" --update-interval 15 "http://your-url.domain/movies.zip"As python module:python -m zipdeploy.zipdeploy --content-destination /dev/shm/your/target/destination --update-interval 15 http://your-url.domain/movies.zipIn your own code (no periodic checks included, threading is your job):from zipdeploy.zipdeploy import ZipDeploy

zd = ZipDeploy("http://your-url.domain/movies.zip", "/dev/shm/your/target/destination")
zd.download_if_required()Using Docker:# make sure to mount /your/target/destination into the container, if you plan to do something useful ;-)
docker run ghcr.io/hgross/zip-deploy --content-destination /your/target/destination --update-interval 15 http://your-url.domain/movies.zipDisclaimerThis project is my playground project to get to know GitHub Actions for automated package publishing/Release pipelines on GitHub.
Don't expect maintenance, but feel free to use this tool if it helps you out.
I created it on a weekend for a friend who set up ane-ink display projecton his Raspberry Pi.
Package: zipdist
zipdistKeeping NumPy and Pandas attributes of python classes nice and tidyThe Zipdist2 class provides methods for saving and reloading NumPy arrays and Pandas DataFrame object attributes.Complex attributes are saved to a single.tar.gzfile.The contents of the.tar.gzprovides a tidy human-readable record of Pandas and Numpy Python class attributes as .csv and binary files.Installpip install zipdist==0.1.3Basic Examplefromzipdist.zip2importZipdist2importpandasaspdimportnumpyasnpimportosclassX():def__init__(self,name):self.name=namex=X(name='example_target_object')x.example_simple_attr=[1989,2020]x.example_np_attr=np.array([[0,1,2,3],[4,5,6,7]])x.example_pd_attr=pd.DataFrame({"A":[1,2,3],"B":[2,4,6]})z=Zipdist2(name="zipper",target=x)z._save(dest="archive",dest_tar="archive.tar.gz")assertos.path.isfile("archive.tar.gz")Saving example_np_attr to .csv : archive/example_np_attr.csv
Saving example_np_attr to .npy : archive/example_np_attr.npy
Saving example_pd_attr to .csv : archive/example_pd_attr.csv
Saving example_pd_attr to .feather : archive/example_pd_attr.feather
Saving JSON with complex attribute definitions : archive/complex_attributes.json
Saving JSON with simple attribute definitions : archive/simple_attributes.json
Combining saved files in : [archive.tar.gz].Contents of archive.tar.gzarchive
├── complex_attributes.json
├── example_np_attr.csv
├── example_np_attr.npy
├── example_pd_attr.csv
├── example_pd_attr.feather
└── simple_attributes.jsonReload All Attributes of a Target Object with._build()x_new=X(name='example_target_object')z=Zipdist2(name="zipper",target=x_new)# You can use the z._build() and reload all object attributesz._build(target=x_new,dest="archive",dest_tar="archive.tar.gz")Setting simple attribute name to example_target_object
Setting simple attribute example_simple_attr to [1989, 2020]
Setting [npy] to [np.ndarray] for attribute example_np_attr from: example_np_attr.npy
Setting [feather] to [pd.DataFrame] for attribute example_pd_attr from: example_pd_attr.featherFor instance:>>>	x_new.example_simple_attr:
[1989, 2020]
>>>	x_new.example_np_attr:
[[0 1 2 3]
 [4 5 6 7]]
>>>	x_new.example_pd_attr:
   A  B
0  1  2
1  2  4
2  3  6Reload Simple and Complex Object Attributes One by One with._ready(),_reload_simple(), and_reload_complex().# You can alternatively use the z._ready() and reload object attributes one by onex_new=X(name='example_target_object')z=Zipdist2(name="zipper",target=x_new)z._ready(target=x_new,dest="archive",dest_tar="archive.tar.gz")z._reload_complex(k='example_np_attr')z._reload_simple(k='example_simple_attr')
Package: zipdump
# zipdump
Analyze zipfile, either local, or from urlzipdumpcan either do a full scan, finding all PK-like headers, or it can do a quick scan ( like the usualzip -vtype output ).zipdump -qworks equally quick on web based resources as on local files.
This makes it quite easy to quickly investigate a large number of large .zip files without actually needing to download them.I wrote this tool because i wanted to look at the contents of lots of apple ios firmware files without downloading 100s of GB of data.For instance:python zipdump.py -qhttp://appldnld.apple.com/ios10.0/031-64655-20160705-A371AD14-3E3F-11E6-A58B-C84C60941A1E/com_apple_MobileAsset_SoftwareUpdate/d75e3af423ae0308a8b9e0847292375ba02e3b11.zipzipdumpworks with both python2 and pyton3.2016 Willem Hengeveld <itsme@xs4all.nl>