Saravanan666/pypi-org huggingface dataset:
Package: importlib-metadata
Library to access the metadata for a Python package.This package supplies third-party access to the functionality ofimportlib.metadataincluding improvements added to subsequent Python versions.CompatibilityNew features are introduced in this third-party library and later merged
into CPython. The following table indicates which versions of this library
were contributed to different versions in the standard library:importlib_metadatastdlib7.03.136.53.124.133.114.63.101.43.8UsageSee theonline documentationfor usage details.Finder authorscan
also add support for custom package installers.  See the above documentation
for details.CaveatsThis project primarily supports third-party packages installed by PyPA
tools (or other conforming packages). It does not support:Packages in the stdlib.Packages installed without metadata.Project detailsProject home:https://github.com/python/importlib_metadataReport bugs at:https://github.com/python/importlib_metadata/issuesCode hosting:https://github.com/python/importlib_metadataDocumentation:https://importlib-metadata.readthedocs.io/For EnterpriseAvailable as part of the Tidelift Subscription.This project and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.Learn more.
Package: importlib-metadata-argparse-version
importlib-metadata-argparse-versionPython'sargparsemodule action to define CLI version with a delayed
call toimportlib.metadata.versiononly when--versionargument
is passed.RationaleWhen you useimportlib.metadatafor adding the version to a CLI utility,
you need to importimportlib.metadataand callimportlib.metadata.version("<your-package>")at initialization time.
If you only want to execute other part of the CLI
(eg. like with the argument--help),importlib.metadatawill be imported
too even when is not needed at all.The problem is easily fixed by this module.Usageimportargparsefromimportlib_metadata_argparse_versionimportImportlibMetadataVersionActionparser=argparse.ArgumentParser()parser.add_argument("-v","--version",action=ImportlibMetadataVersionAction,importlib_metadata_version_from="your-package-name",)This is a rough equivalent to something like:importargparseimportimportlib.metadataparser=argparse.ArgumentParser()parser.add_argument("-v","--version",action="version",version=importlib_metadata.version("your-package-name"),)...but with the difference thatimportlib.metadatawill only be
imported when you call--version, so it is more efficient.When usingImportlibMetadataVersionActiontheversionkwarg
accepts%(version)sas a placeholder like%(prog)s. So you
can write something like this to display the program name before the
version:parser.add_argument("-v","--version",action=ImportlibMetadataVersionAction,importlib_metadata_version_from="your-package-name",version="%(prog)s%(version)s",)# orparser.version="%(prog)s%(version)s"parser.add_argument("-v","--version",action=ImportlibMetadataVersionAction,importlib_metadata_version_from="your-package-name",)And theversionkwarg becomes optional, being"%(version)s"the default value.For convenienceIf you forget to define the kwargimportlib_metadata_version_fromin the argument, aValueErrorwill be raised at initialization time.
Python'sargparsebuilt-in"version"action raises anAttributeErroronly when you call your program with--versionif
you forget to define theversionkwarg, which is less safer because
could lead you to pass the error unexpected until you test it.
And--versionchecking is a really dumb test.
Package: importlib-no-failure
This package is a copy of importlib on pypi with one small change. If the
version of Python already has an importlib (2.7 and greater), it does not fail.
It will install the same way on Python 2.6 and Python 2.7, but in the latter it
will print out a warning.This package contains the code from importlib as found in Python 2.7. It is
provided so that people who wish to use importlib.import_module() with a
version of Python prior to 2.7 or in 3.0 have the function readily available.
The code in no way deviates from what can be found in the 2.7 trunk.For documentation, see theimportlib docsfor Python 2.7.
Package: importlib-resources
importlib_resourcesis a backport of Python standard libraryimportlib.resourcesmodule for older Pythons.The key goal of this module is to replace parts ofpkg_resourceswith a
solution in Python’s stdlib that relies on well-defined APIs.  This makes
reading resources included in packages easier, with more stable and consistent
semantics.CompatibilityNew features are introduced in this third-party library and later merged
into CPython. The following table indicates which versions of this library
were contributed to different versions in the standard library:importlib_resourcesstdlib6.03.135.123.125.73.115.03.101.33.90.5 (?)3.7For EnterpriseAvailable as part of the Tidelift Subscription.This project and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.Learn more.
Package: importlint
ImportLintCheck and fix your module and package imports in python filesUseCheckimportlint check test.pyfiximportlint fix test.pyInstallpip install importlintTODOMake command line interface forAudit file (Done)Correct file in place (Done)Make features: a = can audit, c = can correct[c] Sort imports alphabetically[a] Check for use of * in imports[] Check for unused imports[] Check for no imports for used module[] Consolidate multiple similar imports into one linePackage for pypiMake a setup.pyPublish package!
Package: import-linter
Import Linter allows you to define and enforce rules for the imports within and between Python packages.Free software: BSD licenseDocumentation:https://import-linter.readthedocs.io.OverviewImport Linter is a command line tool to check that you are following a self-imposed
architecture within your Python project. It does this by analysing the imports between all the modules in one
or more Python packages, and compares this against a set of rules that you provide in a configuration file.The configuration file contains one or more ‘contracts’. Each contract has a specific
type, which determines the sort of rules it will apply. For example, theforbiddencontract type allows you to check that certain modules or packages are not imported by
parts of your project.Import Linter is particularly useful if you are working on a complex codebase within a team,
when you want to enforce a particular architectural style. In this case you can add
Import Linter to your deployment pipeline, so that any code that does not follow
the architecture will fail tests.If there isn’t a built in contract type that fits your desired architecture, you can define
a custom one.Quick startInstall Import Linter:pip install import-linterDecide on the dependency flows you wish to check. In this example, we have
decided to make sure thatmyproject.foohas dependencies on neithermyproject.barnormyproject.baz, so we will use theforbiddencontract type.Create an.importlinterfile in the root of your project to define your contract(s). In this case:[importlinter]root_package=myproject[importlinter:contract:1]name=Foo doesn't import bar or baztype=forbiddensource_modules=myproject.fooforbidden_modules=myproject.barmyproject.bazNow, from your project root, run:lint-importsIf your code violates the contract, you will see an error message something like this:=============
Import Linter
=============

---------
Contracts
---------

Analyzed 23 files, 44 dependencies.
-----------------------------------

Foo doesn't import bar or baz BROKEN

Contracts: 1 broken.


----------------
Broken contracts
----------------

Foo doesn't import bar or baz
-----------------------------

myproject.foo is not allowed to import myproject.bar:

-   myproject.foo.blue -> myproject.utils.red (l.16)
    myproject.utils.red -> myproject.utils.green (l.1)
    myproject.utils.green -> myproject.bar.yellow (l.3)
Package: importmagician
importmagicianVoldemort's Python import helperpip install importmagicianImport from uninstalled Python directoriesSay you have a directory (relative path../../dir_a) like this:├── ../../dir_a
        ├── utils
        │   ├── util_a.py
        │   └── ...
        └── ...You wantfunc_afromutils.util_a.py:from importmagician import import_from
with import_from('../../'):
    from utils.util_a import func_a

func_a()  # use func_aThe advantage ofimportmagicianis: outside of thewithstatement, yoursys.pathremains unchanged.
Package: import-me
import mePython tool for importing and validating data from xlsx/xls/csv files.Examplefrom import_me import BaseXLSXParser, Column
from import_me.processors import StringProcessor, IntegerProcessor

>>> class XLSXParser(BaseXLSXParser):
...     columns = [
...         Column('first_name', index=0, header='First Name', processor=StringProcessor()),
...         Column('last_name', index=1, header='Last Name', processor=StringProcessor()),
...         Column('age', index=2, header='Age', processor=IntegerProcessor()),
...     ]

>>> parser = XLSXParser(file_path=xlsx_filepath)
>>> parser()
>>> print(parser.has_errors)  # False
>>> pprint(parser.cleaned_data)
[
    {
        'first_name': 'Ivan',
        'last_name': 'Ivanov',
        'age': 25,
        'row_index': 1,
    },
    {
        'first_name': 'Petr',
        'last_name': 'Petrov',
        'age': 33,
        'row_index': 2,
    },
]Installationpipinstallimport_meContributingWe would love you to contribute to our project. It's simple:Create an issue with bug you found or proposal you have.
Wait for approve from maintainer.Create a pull request. Make sure all checks are green.Fix review comments if any.Be awesome.Here are useful tips:You can run all checks and tests withmake check. Please do it
before TravisCI does.We useBestDoctor python styleguide.We respectDjango CoC.
Make soft, not bullshit.
Package: importmonkey
🐵importmonkeyAn utility for adding new import paths tomake your relativeimportwork without hassle.pip installimportmonkeyWhat does it do?Here is your repository:├─ src
│   └─ project
│       ├─ __init__.py
│       └─ module.py
└─ test
    └─ test.pytest.py can't find module.py:ModuleNotFoundError:Nomodulenamed'module'ImportError:attemptedrelativeimportwithnoknownparentpackageSystemError:Parentmodule''notloaded,cannotperformrelativeimportimportmonkey will fix that:fromimportmonkeyimportadd_path# In test.pyadd_path("../src")importprojectWhy?Show detailsSometimes you want a specific repo structure to test and build a package from the same
files so you need a relative / sibling / parent import.DocumentationShow details>>>importimportmonkey>>>help(importmonkey.add_path)>>># Or take a look at the well documented source.Development detailsShow detailsLintingimportmonkey$python-mblack.
importmonkey$python-mflake8src/test/Testingimportmonkey$pythontest/run_test_suite.pyBuilding & releasing# Remember to increment __version__ in __init__.pyimportmonkey$python-mbuild--wheel&&rm-rfbuild/&&rm-rfsrc/importmonkey.egg-info/
importmonkey$importmonkey$python-mtwinecheckdist/*
importmonkey$python-mtwineuploaddist/*
importmonkey$rm-rfdist/Additional licensingShow detailsThis software is licensed under The Unlicense as the author's protest towards
the modern copyright landscape. If you need a different lisence for legal or
compability reasons, just ask.
Package: import-order
CLI that check the ordering of imports. ordering follow a below rules.Module order:__future__, standard libraries, site-packages, local.CONSTANT_NAMESmust be the first.ClassNamesmust be the second.Rest must be in alphabetical order.RequirementsPython 2.7.x or Python 3.3+How to installVia pip$ pip install -U import-orderOr clone source code from repository and install it.$ git clone https://github.com/spoqa/import-order.git
$ cd import_order
$ python setup.py install # or pip install .How to useUseimport-orderto check your python codes. If you want to check your
local package namedfooin root directory of package.$ import-order fooIf you check your directorybarwith local packages (foo,baz).$ import-order foo ./bar bazOr you can check your directorybar, filesome.pywithout
local packages (if--only-fileis missing, it will raiseValueError).$ import-order --only-file ./bar some.pyFor more information, look around help command.$ import-order --helpWhen you ignore order on purpose, simply add# no import orderat the
import statement.fromfoo.barimportb,a,c# no import orderAuthor and licenseimport-order is maintained bySpoqa, and licensed
underGPL3or later.
Package: import-parent-dir
import_parent_dir=================.. image:: https://img.shields.io/pypi/v/import_parent_dir.svg:target: https://pypi.python.org/pypi/import_parent_dir:alt: Latest PyPI version.. image:: .png:target::alt: Latest Travis CI build statusUsage-----Installation------------Requirements^^^^^^^^^^^^Compatibility-------------Licence-------Authors-------`import_parent_dir` was written by `fx-kirin <fx.kirin@gmail.com>`_.
Package: import-profile
import_profileWant to know how much time and memory each of your Python imports costs?Find out withimport_profile!Just do:python3 -m import_profile flask sqlalchemy flask_sqlalchemy pandas numpyAnd you will get:flask sqlalchemy flask_sqlalchemy numpy pandas

                   time cpu.user cpu.system memory.uss memory.rss
flask              0.15     0.12       0.02       9.92      13.08
sqlalchemy         0.10     0.09       0.01       5.09       5.22
flask_sqlalchemy   0.07     0.07       0.00       3.45       3.43
numpy              0.12     0.12       0.09       7.52      12.31
pandas             0.35     0.28       0.06      17.78      25.10
*base*             0.00     0.05       0.02       5.96      11.61

time       = seconds of real time since the import trial began
cpu.user   = seconds of CPU time spent in this process
cpu.system = seconds of CPU time spent waiting for the OS kernel, such
             as waiting for file I/O to complete
memory.uss = unique set size - memory taken up by process, minus
             shared objects/DLLs (megabytes)
memory.rss = resident set size (megabytes)
Package: import-profiler
# import-profilerA basic python import profiler to find bottlenecks in import times. While notoften a problem, imports can be an issue for applications that need to startquickly, such as CLI tools. The goal of import profiler is to help find thebottlenecks when importing a given package.## ExampleThis is Work in Progress. To try it out, write something as follows:``` pythonfrom import_profiler import profile_importwith profile_import() as context:# Anything expensive in hereimport requests# Print cumulative and inline times. The number of + in the 3rd column# indicates the depth of the stack.context.print_info()```Output:```cumtime (ms)    intime (ms)  name83              0.5  requests55              0.5  +packages.urllib3.contrib54.1            0.3  ++53.1            0.7  +++connectionpool6.3            1.1  ++++logging1.4            0.5  +++++collections2.7            1.3  +++++threading1.4            0.3  ++++++re7              0.7  ++++socket5.7            5.7  +++++_ssl7              0.1  ++++packages.ssl_match_hostname6.9            0.1  +++++6.8            2.3  ++++++ssl3.2            1.5  +++++++textwrap1.7            1.6  ++++++++string12              0.4  ++++connection7.7            1.1  +++++httplib2.3            2.3  ++++++urlparse4.2            0.2  ++++++mimetools3.4            0.3  +++++++tempfile2.1            1.4  ++++++++random3.6            0.1  +++++util.ssl_1.1            1    ++++++url16.4            0.2  ++++request1.5            1.4  +++++urllib.parse14.7            0.2  +++++filepost9.1            6    ++++++uuid2.9            1.7  +++++++ctypes5.4            0.2  ++++++fields4.8            1.7  +++++++email.utils2.4            0.2  ++++++++email._parseaddr2.2            0.7  +++++++++calendar1.4            1.4  ++++++++++locale1.2            0.4  ++++response24.8            0.4  +1.8            1.7  ++cgi5.4            5.4  ++platform15.1            0.1  ++compat2.4            0.2  +++json1.5            0.5  ++++decoder1.6            1.3  +++urllib27.6            6.8  +++cookielib3              2.5  +++Cookie1.5            0.6  +models1              0.1  +api```# Missing featuresWe don't track where imports happen: it would be nice to know where a givenimport in the profile output happens.
Package: import-r
Python-style imports of R files and packagesAn rpy2 wrapper package to enable Python-style imports of R files and packages
and expose them as commandline tools (based on python-fire), including automatic pandas
object conversion if it is installed.Setuppip install import-rUsageImport any R installed package or R file in your working dir or on either$RPYPATHor$R_LIBSpaths
like any other python module:from r import test
    import r.test as rtest
    from r import ggplot2
    import r
    r.path.append('dir/to/my/rfiles')
    from r import my_rfileCommandline interfaceInstall with cli support (pip install import-r[rcli]) and then use R files and packages on the commandline
like this:rcli utils install_packages ggplot2
    rcli path/to/my/rfile.R function1 --arg=2 --flagTest and releasepip install .[test]
pytest
python setup.py sdist
twine upload dist/*Once everything passed successfully, tag and push to github:version=0.1
git commit -m "Release v${version}"
git tag "v$version"
git push; git push --tagsCreditMichel Wortmannmichel.wortmann@ouce.ox.ac.ukMIT Licence
Package: import-ready
import-readyThis repository demonstrates steps needed to publish an importable Python package first toTestPyPI, and second toPyPI.  If this demonstration deviates from best practice in any way, please submit anissueon GitHub.Insideimport-readyis a package calledhuntsville_havocthat divulges a couple of bona fide secrets that most diehard SPHLHuntsville Havocfans don't know.Prepare the PackagePrepare your environmentbefore installing Python packages.Update version in setup.py persemantic versioningguidance.Test in Development EnvironmentRun as follows from the top level directory in a clean venv withpip-toolsinstalled:python -m piptools compile --upgrade --generate-hashes dev-requirements.in
python -m piptools sync dev-requirements.txt
python -m pytest -s testsPublish to TestPyPIGit commit, tag, & push all desired edits for release.Create a new release in GitHub to mirror your new version.Generate distribution archivesfor your package.Upload your packageto TestPyPI.Test the TestPyPI-Published PackageRun as follows from thetestsdirectory in another clean venv withpip-toolsinstalled:TEST_PYPI_FLAG='--extra-index-url https://test.pypi.org/simple/'
python -m piptools compile --upgrade --generate-hashes $TEST_PYPI_FLAG \
      --output-file testpypi-requirements.txt pub-requirements.in
python -m piptools sync $TEST_PYPI_FLAG testpypi-requirements.txt
python -m pytest -sPublish to PyPIAfter passing the above tests,upload your packageto PyPI.Test the PyPI-Published PackageRun as follows from thetestsdirectory inyet anotherclean venv withpip-toolsinstalled:python -m piptools compile --upgrade --generate-hashes \
      --output-file pypi-requirements.txt pub-requirements.in
python -m piptools sync pypi-requirements.txt
python -m pytest -sThanksLicenseMIT
Package: import_relative
IntroductionMore akin torequire_relativeof Ruby than Python’simport_relative.When you have a large package that contains nested submodules this allows the nested submodules to refer to one another without having to pull in or know much about or explicitly import entire top-level tree.Synopsisfrom import_relative import import_relative, get_srcdir
# Below "trepan" is my top-level namespace
# 'io' is the directory this file is in.
Mbase = import_relative('base', '.', 'trepan) # Adds trepan.io.base
# The following adds trepan.lib.bytecode
Mbytecode = import_relative('bytecode', '..lib', 'trepan)

class MyClass(Mio.InputBase): # Use name from Mio
   ...

# like os.path.realpath(os.path.dirname(__file__))
srcdir = get_srcdir()No import path searching is done. If the imports are not there, we fail.RationaleIn my development, each module (which is a file in Python) can be run standalone. When called as a main program, it runs demo code. Each module is responsible for importing those other modules it needs.I have not been able to get relative imports to work nor have I been able to useimportlibeither in Python 2 or 3. They seem to error out because they can’t find upper levels or something like that.BugsSorry, we don’t do “from lists”.Various packing systems like pip and loaders may not work with this.
This code is fragile.I keep wanting to believe that there is already a way to develop out of the source code tree (not a copy of it as distutils is wont to do), not fiddle with search paths, and have demo code in modules so they can be run equally well as a main program and embedded as a module in the entire system.Until then, I have this.
Package: importreqs
A simple Python lib for extracting reqs.txt from currently imported libs
in the context. The lib can be used in the following scenarios:Gathering the dependencies for serverless frameworks such as AWS
Lambda. If several functions share the same virtualenv, unused
dependecies may be introduced viapip freeze. Use importreqs will
expose only the reqs imported.Remove unused dependencies after refactoring, or on a long time
maintained projects.Installpip install importreqsUsageTo use importreqs:import importreqs
importreqs.generate_reqs(replace_version_hash=False,
                         exclude=None)replace_version_hash: For editable reqs(with -e when using pip
install), remove the commit hash from result.exclude: Exclude listed packages from the result. For example,
importreqs itself.For example:# import your own projects
# for example "import app"

import importreqs

print(importreqs.generate_reqs(exclude=['importreqs']))Or use importreqs from command line:importreqs -c "import requests"
Package: imports
ImportsA helper tool to identify unused installed packagesFree software: MIT licenseDocumentation:https://imports.readthedocs.io.FeaturesList all installed packages added on the project requirements that are not usedCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2018-03-20)First release on PyPI.0.1.2 (2018-03-22)Fix minor issues.Update documentationMinor code improvements0.1.4 (2018-03-23)Improve testsFix minor issues
Package: importscan
importscanprovides ascanfunction that lets you recursively
import a package and its sub-modules and sub-packages.Documentation.CHANGES0.2 (2020-01-29)Removed: Removed support for Python 2.You have to upgrade to Python 3 if you want to use this version.Dropped support for Python 3.3Added support for Python 3.5, 3.6, 3.7, 3.8 and PyPy 3.6.Make Python 3.7 the default testing environment.Fix deprecated and legacy code.Use virtualenv and pip instead of buildout to set up the
development environment.Add development documentation and reorganize documentation.Upload universal wheels to pypi during release.Clean up the development and release workflow.Add integration for the Black code formatter.0.1 (2016-03-15)Initial public release.