Saravanan666/pypi-org huggingface dataset:
Package: constancy
python-constancyContainer for constants.InstallingpipinstallconstancyExample:fromconstancyimportConstantsCreate container for constants>>>DAYS=Constants(...MON=0,...TUE=1,...WED=2,...THU=3,...FRI=4,...SAT=5,...SUN=6...)Get value from container>>>DAYS.MON0>>>DAYS['MON']0Represent with pure python data structures>>>list(DAYS)['MON','TUE','WED','THU','FRI','SAT','SUN']>>>dict(DAYS){'WED':2,'SUN':6,'FRI':4,'THU':3,'MON':0,'TUE':1,'SAT':5}All constants are immutable>>>DAYS.MON=7...AttributeError:Immutableattribute>>>delDAYS.MON...AttributeError:ImmutableattributeAutocomplete only for constants>>>dir(DAYS)['FRI','MON','SAT','SUN','THU','TUE','WED']Sorting likelist.sort>>>DAYS.sort(key=lambdak,v:v,reverse=True)>>>list(DAYS)['SUN','SAT','FRI','THU','WED','TUE','MON']
Package: constant
Welcome to constant DocumentationIf you have lots of constant value widely used across your development. A better way is to defineConstant Variablerather than using the raw value. This will improve the readability of your codes.constantis a library provide extensive way of managing your constant.Example:fromconstantimportConstantfromconstant.pkg.sixminiimportPY3classFood(Constant):classFruit(Constant):id=1name="fruit"classApple(Constant):id=1name="apple"classRedApple(Constant):id=1name="red apple"classGreenApple(Constant):id=2name="green apple"classBanana(Constant):id=2name="banana"classYellowBanana(Constant):id=1name="yellow banana"classGreenBanana(Constant):id=2name="green banana"classMeat(Constant):id=2name="meat"classPork(Constant):id=1name="pork"classMeat(Constant):id=2name="meat"You can visit it’s data or child class data in these way.>>>Fruit.items()# .items() return it's data[('id',1),('name','fruit')]>>>Fruit.keys()# .keys() return keys['id','name']>>>Fruit.keys()# .values() return values[1,'fruit']>>>Fruit.to_dict()# return data in a dict{'id':1,'name':'fruit'}# iterate on all child class>>>Fruit.collection(sort_by='id')[classApple,classBanana]# get first child class that kls.id == 1# useful when you need reverse lookup>>>Fruit.get('id',1)classApple>>>Fruit.get('id',1,multi=True)# get all child class that kls.id == 1[classApple,]Quick LinksGitHub HomepageOnline DocumentationPyPI downloadInstallIssue submit and feature requestAPI reference and source codeInstallconstantis released on PyPI, so all you need is:$pipinstallconstantTo upgrade to latest version:$pipinstall--upgradeconstant
Package: constant2
Welcome toconstant2DocumentationIf you have lots of constant2 value widely used across your development. A better way is to defineConstantant Variablerather than using the raw value. This can improve the readability and accessibility.constant2is a library provide extensive way of managing your constant2 variable.Another powerful featureis,constant2allows developer defines normalized entity relationship and is data inclassstyle, which giving awesome accessibility to every single row, and every single column, free developer from memorizing things.Quick LinksUsageVersion Changed 0.0.9: All nested class now has to inherit fromConstantor its subclass:# WRONG!classItemType(Constant):classWeapon:id=1# CORRECTclassItemType(Constant):classWeapon(Constant):id=1# orclassItem(Constant):passclassItemType(Constant):classWeapon(Item):id=1Usage:fromconstant2importConstantclassFood(Constant):classFruit(Constant):id=1name="fruit"classApple(Constant):id=1name="apple"classRedApple(Constant):id=1name="red apple"classGreenApple(Constant):id=2name="green apple"classBanana(Constant):id=2name="banana"classYellowBanana(Constant):id=1name="yellow banana"classGreenBanana(Constant):id=2name="green banana"classMeat(Constant):id=2name="meat"classPork(Constant):id=1name="pork"classBeef(Constant):id=2name="beef"food=Food()You can visit it’s data or child class data in these way:# Use class>>>Fruit.Items()# .Items() return it's data[('id',1),('name','fruit')]>>>Fruit.Keys()# .Keys() return keys['id','name']>>>Fruit.Values()# .Values() return values[1,'fruit']>>>Fruit.ToDict()# return data in a dict{'id':1,'name':'fruit'}# use instance>>>food.items()# .Items() return it's data[('id',1),('name','fruit')]>>>food.keys()# .keys() return keys['id','name']>>>food.values()# .values() return values[1,'fruit']>>>food.to_dict()# return data in a dict{'id':1,'name':'fruit'}# iterate on all nested class>>>Fruit.Subclasses(sort_by='id')[classApple,classBanana]# get first nested class that kls.id == 1# useful when you need reverse lookup>>>Fruit.GetFirst('id',1)classApple# get all child class that kls.id == 1>>>Fruit.GetAll('id',1)[classApple,]And it provides built-in I/O methods allow you to dump these data in to a dictionary.>>>data=Food.dump()>>>data{"Food":{"Fruit":{"Apple":{"GreenApple":{"__classname__":"GreenApple","id":2,"name":"green apple"},"RedApple":{"__classname__":"RedApple","id":1,"name":"red apple"},"__classname__":"Apple","id":1,"name":"apple"},"Banana":{"GreenBanana":{"__classname__":"GreenBanana","id":2,"name":"green banana"},"YellowBanana":{"__classname__":"YellowBanana","id":1,"name":"yellow banana"},"__classname__":"Banana","id":2,"name":"banana"},"__classname__":"Fruit","id":1,"name":"fruit"},"Meat":{"Beef":{"__classname__":"Beef","id":2,"name":"beef"},"Pork":{"__classname__":"Pork","id":1,"name":"pork"},"__classname__":"Meat","id":2,"name":"meat"},"__classname__":"Food"}}>>>Food=Constant.load(data)Installconstant2is released on PyPI, so all you need is:$pipinstallconstant2To upgrade to latest version:$pipinstall--upgradeconstant2
Package: constantcontact
Constant Contact Python 2.x SDK for the v2 API.## InstallationInstalling the python sdk is simple.` $ pip install constantcontact `## DocumentationThe Github pages for this repo are located [here](http://lambertwang.github.io/ctct-python-sdk/)
And the API Documentation can be found [here](http://developer.constantcontact.com/docs/developer-guides/api-documentation-index.html)
Package: constantcontact-unofficial
Constant Contact Python 2.x SDK for the v2 API.## InstallationInstalling the python sdk is simple.` $ pip install constantcontact `## DocumentationThe Github pages for this repo are located [here](http://magellantoo.github.io/ctct-python-sdk/)
And the API Documentation can be found [here](http://developer.constantcontact.com/docs/developer-guides/api-documentation-index.html)
Package: constantdict
constantdictAn immutable dictionary class for Python, implemented as a thin layer arounddict. It is oftenfaster than other immutable dictionary implementations.UsageInstall this package with:$ pip install constantdictUsage example:fromconstantdictimportconstantdictcd=constantdict({1:2})# constantdicts compare equal to dicts with the same itemsassertcd=={1:2}# constantdicts are hashable, and their hashes are cachedprint(hash(cd),cd)# Attempting to modify the constantdict raises an AttributeErrortry:# Similar for pop(), popitem(), clear(), __ior__(), del, and setdefault()cd[4]=12exceptAttributeError:passPlease also see thedocumentation.LicenseMIT License.
Package: constantly
A library that provides symbolic constant support.  It includes collections and
constants with text, numeric, and bit flag values.  Originallytwisted.python.constantsfrom theTwistedproject.Installingconstantly is available inPyPI, and
can be installed via pip:$ pip install constantlyDocumentationDocumentation is available athttps://constantly.readthedocs.io/en/latest/.TestsTo run tests:$ toxThis will run tests on Python 2.7, 3.3, 3.4, and PyPy, as well as doing
coverage and pyflakes checks.
Package: constant-nums
ConstantWhenever I think about to make that thing (intenger,float, dataframe , array) constant. it works mostly on all the languages but not in python. So, I decided to create a package for constant numbers like pi and etc. That should be easy. So, here it is.How to use it!First install library -pip install constant_numsafter that,from constant_nums import finalbasic syntax should be like this only<constant_name> = final.cons(,<constant_name>)Now here unit means anything, like int,str,dataframe and array anything. The name of the constant should be same on both the sides. Otherwise it won't be a constant anymore.Example :pi = final.cons(3.14, "pi")and voila it works.Now, there is already a module available for some default constants like PI, Euler's number etc but not for custom.
You can create your own constants here.
Package: constant-properties-protector
Constant Properties Protector PackageWith the help of this module, you can protect some of the properties in a class. Protecting means avoiding to change them but keep them publicly available.fromconstant_properties_protectorimportCPPclassA:def__init__(self):CPP.protect(self,'initialized_protected')CPP.protect(self,'uninitialized_protected')self._initialized_protected=12a=A()print(a.initialized_protected)# >>> 12a.t=2print(a.t)# >>> 2a.initialized_protected+=1# Exception: Can not modify constant property: initialized_protecteda.uninitialized_protected=10# Exception: Can not modify constant property: uninitialized_protectedclassB(A):def__init__(self):super().__init__()CPP.protect(self,'new_protected_value')self._new_protected_value=26b=B()print(b.new_protected_value)# >>> 26b.new_protected_value+=2# Exception: Can not modify constant property: new_protected_valueNOTE:There is no need to inherit from CPP.Use_first of the protected property name to get full access to it.Useprotectfunction to add to protected properties.CPP will define python properties for your class. So it affects the class, not the instance. DON'T use CPP to protect property in runtime. Use it to define protected values for all instances of a class.Installationpip install constant-properties-protector
Package: constantQ
A Constant Q Transform based on GWpy qtransformThe creation of this program was inspired by the need to include a CQT package with minimal size and dependency for SHARCNET (ComputeCanada) Supercomputer Clusters.# IMPORTANT DISCLAIMER: All credits for the original Q transform algorithm go to the authors of *GWpy* and *Omega* pipeline.
# See original algorithms at: [Omega Scan] https://gwdetchar.readthedocs.io/en/stable/omega/
#                             [GWpy] https://gwpy.github.io/docs/stable/
#          particularly       [GWpy qtransform]
#              - https://github.com/gwpy/gwpy/blob/26f63684db17104c5d552c30cdf01248b2ec76c9/gwpy/signal/qtransform.py
#
# The license information does NOT imply this package (constantQ) as the original q transform/q scan algorithm.
# NOTE: Referenced programs are under the GNU license 
# for more information on the license visit: https://www.gnu.org/licenses/gpl-faq.en.htmlHow to use it:Step 1: Generating a chirp signalimportnumpyasnp# Generate np.array chirp signaldt=0.001t=np.arange(0,3,dt)f0=50f1=250t1=2x=np.cos(2*np.pi*t*(f0+(f1-f0)*np.power(t,2)/(3*t1**2)))fs=1/dtplt.plot(x)# plot the chirp signalplt.show()# displayStep 2: Generating a TimeSeries objectfromconstantQ.timeseriesimportTimeSeriesseries=TimeSeries(x,dt=0.001,unit='m',name='test',t0=0)#np.array --> constantQ.timeseriesStep 3: Q Transformhdata=seriessq=hdata.q_transform(search=None)# q transformprint(len(sq[0]))# freq array lengthprint(len(sq))# time array lengthplt.imshow(sq.T,origin='lower')# plot the spectrogramplt.colorbar()# colorbarplt.show()# displayTo compare the result with a Scipy Spectrogramfromscipyimportsignalasscisignalfreq,ts,Sxx=scisignal.spectrogram(x)# scipy spectrogramplt.pcolor(ts,freq,Sxx,shading='auto')# plot the spectrogramplt.colorbar()# colorbarplt.show()# displayThis test version 0.0.1 largely follows the GWpy architecture. Changes will be made in future updates if a different structure is better for this package.
Package: constants-and-utils
Constants and UtilsPackage with constants and generic utilitiesPackage installationInstallation standard$pip3installconstants-and-utilsInstall with mongoengine utils$pip3installconstants-and-utils[mongoengine]DocsConstants and utils documentationExamples:recursive_getthis is a helper, apply a get recursive to the dictionary.>>>fromconstants_and_utils.utils.helpersimportrecursive_get>>>recursive_get({'NUMBER':{'ONE':1}},'NUMBER.ONE')1HttpCodethis is a class enum, Http code constants.>>>fromconstants_and_utils.constants.enumsimportHttpCode>>>HttpCode.OK.value200More
Package: constants-set
Constants-setSimple constants sets for Python.Kind of like enums, reusable constants.Kind of convenient for Django and DRF.Installpip install constants-setUse casesSimple pythonfromconstants_setimportConstantsSetclassBook:TYPES=ConstantsSet(["ROMANCE","ACTION"])def__init__(self,type):self.type=typedefget_global_feeling(self):ifself.type==Book.TYPES.ROMANCE:return'love'ifself.type==Book.TYPES.ACTION:return'intensity'Django modelfromdjango.dbimportmodelsclassBookModel(models.Model):type=models.CharField(max_length=30,choices=Book.TYPES.to_choices(),default=Book.TYPES.ROMANCE)Django rest framework serializerfromrest_frameworkimportserializersclassBookSerializer(serializers.Serializer):type=serializers.ChoiceField(required=True,choices=Book.TYPES.to_choices())
Package: constcheck
Check Python files for repeat use of stringsEscape commas with \\ (\ when enclosed in single quotes)Defaults can be configured in your pyproject.toml fileInstallation$pipinstallconstcheckUsageCommandlineusage: constcheck [-h] [-v] [-n] [-c INT] [-l INT] [-s STR] [-i LIST] [-I LIST]
                             [--ignore-from [FILE=LIST [FILE=LIST ...]]]
                             [path [path ...]]

Check Python files for repeat use of strings. Escape commas with \\. Defaults can be configured in
your pyproject.toml file.

positional arguments:
  path                                       path(s) to check files for (default: .)

optional arguments:
  -h, --help                                 show this help message and exit
  -v, --version                              show program's version number and exit
  -n, --no-ansi                              disable ansi output
  -c INT, --count INT                        minimum number of repeat strings (default: 3)
  -l INT, --length INT                       minimum length of repeat strings (default: 3)
  -s STR, --string STR                       parse a string instead of a file
  -i LIST, --ignore-strings LIST             comma separated list of strings to exclude
  -I LIST, --ignore-files LIST               comma separated list of files to exclude
  --ignore-from [FILE=LIST [FILE=LIST ...]]  comma separated list of strings to exclude from fileAPI>>>fromconstcheckimportconstcheck>>>EXAMPLE="""
... STRING_1 = "Hey"
... STRING_2 = "Hey"
... STRING_3 = "Hey"
... STRING_4 = "Hello"
... STRING_5 = "Hello"
... STRING_6 = "Hello"
... STRING_7 = "Hello"
... STRING_8 = "Hello, world"
... STRING_9 = "Hello, world"
... STRING_10 = "Hello, world"
... STRING_11 = "Hello, world"
... STRING_12 = "Hello, world"
... """>>>constcheck(string=EXAMPLE)3|Hey4|Hello5|Hello,world<BLANKLINE>1With thecountargument>>>constcheck(string=EXAMPLE,count=4)4|Hello5|Hello,world<BLANKLINE>1With thelengthargument>>>constcheck(string=EXAMPLE,length=6)5|Hello,world<BLANKLINE>1With theignore_stringsargument which acceptslistofstrobjects>>>constcheck(string=EXAMPLE,ignore_strings=["Hello, world","Hello"])3|Hey<BLANKLINE>1ConfigAll keyword arguments available toconstcheck()can be configured in the pyproject.toml file[tool.constcheck]path="."count=3length=3ignore_strings=["Hello","Hello, world"]ignore_files=["tests/__init__.py"]filter=falseno_color=false[tool.constcheck.ignore_from]"tests/__init__.py"=["Hello, world"]pre-commitconstcheckcan be used as apre-commithookIt can be added to your .pre-commit-config.yaml as follows:repos:-repo:https://github.com/jshwi/constcheckrev:v0.7.0hooks:-id:constcheckargs:-"--count=3"-"--length=3"
Package: constdb
ConstDB is a very simple and fast read-only embedded key-value database. Keys consist of 64-bit integers or strings and values consist of arbitrary byte strings.Sampleimportconstdbwithconstdb.create('db_name')asdb:db.add(-2,b'7564')db.add(3,b'23')db.add(-1,b'66')withconstdb.read('db_name')asdb:assertdb.get(-2)==b'7564'assertdb.get(-1)==b'66'assertdb.get(3)==b'23'DocumenationConstDB contains only two functions:createandread.create(filename)allows you to create a new ConstDB database.
It takes a filename and returns a ConstDBWriter. A ConstDBWriter has two methods:add(key, value): Adds a key-value pair to the database. The key must be a 64 bit integer or a string. The value must be a byte string.close(): Finalize and close the database.read(filename)allows you to read an existing ConstDB database.
It takes a filename and returns a ConstDBReader. A ConstDBReader has two methods:get(key): Get a value from the database. The key must be a 64 bit integer or a string. Returns the value if the key is in the database. Returns None if the key is not found.close(): Finalize and close the database.RequirementsThe only requirement for ConstDB is Python 3.
Package: constellat-broadcast-service
broadcast-servicebroadcast-service is a lightweight python broadcast library. You can easily construct a broadcast pattern through this library.ReferencePython最佳实践-构建自己的第三方库Setuppipinstallconstellat-broadcast-serviceUsageThere is a easy demo to show how to use broadcast-service.frombroadcast_serviceimportbroadcast_servicedefhandle_msg(params):print(params)if__name__=='__main__':info='This is very important msg'# listen topicbroadcast_service.listen('Test',handle_msg)# publish broadcastbroadcast_service.broadcast('Test',info)Upload# 打包项目pythonsetup.pysdist# 上传包twineuploaddist/*
twineuploaddist/constellat_broadcast_service.tar.gz
Package: constellate
constellateLike a constellation, this package is an aggregation of various utilities built over time.InstallationInstall python virtual envs needed by tox/IDEbash make.sh --setup-python-dev-envspip install constellateUsageRun tests (locally)POSTGRES_USER=test;POSTGRES_PASSWORD=not_needed bash make.sh --destroy-database --run-database --run-testsLintbash make.sh --lint
Package: constellate-client
Constellate ClientNotebook client for Constellate.See documentation:https://constellate.org/docs/constellate-clientTo import and verify installation:importconstellatedataset=constellate.get_description("0e912814-41d2-82b3-2463-5472700303e3")print(dataset["search_description"])If the library is installed properly, the following output will be displayed:inflation from JSTOR from 1910 - 1920
Package: constellation-pkgtools-cli
This tool allow you to create, run and publish Constellation packages from a CLI. For more information go to theConstellation Developer Portal.Installationpip installconstellation-pkgtools-cliUsagectln create <name> [<project_template_name>]: Create a new Constellation package. If not set the default project template will be used.ctln template listto view available templates.ctln update: update the current Constellation package with the lastest template.ctln run[--server=<name>]: run the current Constellation package is standalone mode or connected to the specified Constellation server.ctln publish--output=<directory>[--filename=<name>]: publish the current Constellation package to the specified directory.ctln publish <server_name>[--filename=<name>]: publish the current Constellation package to the specified Constellation server.ctln pyscript list: list the Python scripts register by this Package configuration.ctln pyscript add <filepath>[--filename=<name>]: add the specified Python file to the current Constellation package.ctln pyscript new <filename> [<item_template_name>]: add new Python file to the current Constellation package.ctln pyscript remove <filename>: remove Python file from the current Constellation package.ctln pyscript rename <old_name> <new_name>: rename Python file on the current Constellation package.ctln server list: list the Constellation Servers.ctln server (add | set) <name>--url=<url>--accesskey=<key>: add or update a Constellation Server by using access key.ctln server (add | set) <name>--url=<url>--username=<user>: add or update a Constellation Server by using username & password.ctln server remove <name>: remove Constellation Server.ctln server check <name>: check the Management API connection for the specified Constellation Server.ctln template list: list the available project and item templates.ctln(-h|--help): show the Constellation Package Tool CLI usage.ctln(-v|--version): show the Constellation Package Tool CLI version.
Package: constellatus
ConstellatusConstellatus is an extension of the Eons APIE executable. It provides a RESTful API for storing, retrieving, and optimizing code written within the Eons framework.Our goal is to automate the process of translation.By refining our code for us, Constellatus allows us make succinct statements that are easy for others to use.We make heavy use of astronomy metaphors.OverviewStarsare fully formedSelfRegisteringclasses.We measure the mass of code by its behavior. Well structured, well performing, easily repeatable behavior results in higher mass (e.g. one program has a deeper gravity well than another that does the same thing but is slower).We model matter as the quantity of code, regardless of its behavior.The "density" of a particular bit of code is measured by how well it behaves over how much code it contains.The Eons Error Resolution machinery (EER) is our corollary to nuclear fusion: it takes code that is not well behaved but could be (i.e. low mass) and improves its behavior, increasing its gravitational force and thus its mass.To illustrate what "could be well behaved" means, imagine code which operates perfectly but is missing context, e.g. requires an additional include statement or a package to be installed. These kinds of errors, which are trivial to resolve, provide the fuel for the EER machinery. This is useful as it allows us as programmers to write only what is necessary, and have all dependencies automatically injected.StarsThe minimum requirement for a SelfRegistering class to be a Star is that it possess enough well behaved code such that it requires no interaction with the Eons Error Resolution machinery to be instantiated.
Stars may progress through a normal lifecycle of improvements, whereby they become increasingly dense. This process is similar to how a user might implement Cython: small, well behaved units of the Star are replaced with code from Biology, C++, C, or Assembly. Code that is not well behaved is refined through repeated application of the Eons Error Resolution machinery.
A Star's lifecycle is entirely managed by Constellatus. Stars may be Formed and Destroyed but their updates are entirely automated.
They key to making Constellatus work is the continual rewrite of the code of Stars so that each time it's Observed, it becomes more compact.Installationpip install constellatusUsageFor now, refer toApiefor all configuration.When running as a webserver, the default port is 1137, after the approximation for thefine structure constant: 1/137.
Package: constellix
Python Library for Constellix APIDescriptionConnects to theConstellix APIand does thingsNoteThis is in no way affiliated with Constellix.IssuesThe tokens generated by this library are rejected about 50% of the time.
The library usesbackoffto manage these failures and typically takes less than 20 retries per payload to get the response you want.Logging / DebuggingThis library usesloggingjust set the log level and format you need.ExampleSet up environmentexportCONSTELLIX_APISECRET=48d4ebb7-246e-406a-b272-2e174a3bdf35exportCONSTELLIX_APIKEY=b6f11837-9858-4f7f-8b3f-50057355e8e9List all domains in accountfromconstelliximportConstelliximportasyncioapi_key=os.environ.get("CONSTELLIX_APIKEY")secret_key=os.environ.get("CONSTELLIX_APISECRET")asyncdeflist_all_domains(api):domains=awaitapi.domains.all()print(domains)loop=asyncio.get_event_loop()api=Constellix(api_key=api_key,secret_key=secret_key,loop=loop)loop.run_until_complete(list_all_domains(api))Search for a domaindomains=awaitapi.domains.search("example")domains=awaitapi.domains.search_startswith("example")domains=awaitapi.domains.search_endswith("com")domains=awaitapi.domains.search_exact("example.com")Create a new domaindomain=awaitapi.domains.create("example.com")And then delete itdelete_success=awaitdomain.delete()Get all a domains recordsall_records=awaitdomain.records.all()Support