Saravanan666/pypi-org huggingface dataset:
Package: classutilities
Class utilitiesAuthor: David Salachttps://github.com/david-salacSimple package with helpful utilities for classes.
That includes class level properties and filters for
configuration classes.Note:this package does not require any external dependencies.How to install packageUse PIP command:pip install classutilitiesHow to use class level propertiesClass level properties are properties defined on
class level. They behave exactly the same as
normal properties (but allow being called on
class level and not only on instance level).Consider the following example (defining class
level properties):importclassutilitiesclassSomeClass(classutilities.ClassPropertiesMixin):_some_variable=8# Some class variable@classutilities.classpropertydefsome_variable(cls):# Example of getterreturncls._some_variable@some_variable.setterdefsome_variable(cls,value):# Example of settercls._some_variable=valueClassPropertiesMixinallows you to use a setter for
properties. However, if you only need a getter, it will
work even without this mixin.Usage of class-level properties:# Getter:value=SomeClass.some_variableprint(value)# >>> 8# Setter:new_value=9SomeClass.some_variable=new_valueprint(SomeClass.some_variable)# >>> 9print(SomeClass._some_variable)# >>> 9As you can see, class-level properties behave very
naturally.Configuration classesConfiguration classes usually follow standard patterns, mainly:All members have to be upper case (if they do not start
with an underscore).There is no constructor in the class.There is no standard (instance) method in the class. Only
class methods and static methods are allowed.It is beneficial to have some validator for a configuration
class that checks if all these conditions are followed.
This is precisely what ConfigClassMixin does. Consider
the following use-case:importclassutilitiesclassSomeConfigClass(classutilities.ConfigClassMixin):# This is OK:DATABASE_HOST="localhost"# OK: variable name in uppercaseDATABASE_NAME="testing"# OK: variable name in uppercase# ...# This is NOT OK (class variables must be uppercase):database_password="pass"# NO: must not be lowercase# This is OK (underscore on the beginning):_api_version="1.0.0"# OK: starts with an underscore# This is OK:@classmethoddefconnect_to_database(cls):# Class methods are acceptablereturn...# This is OK:@staticmethoddefcheck_status():# Static methods are acceptablereturn...# This is NOT OK:defcheck_parameters(self):# No instance-level methodsreturn...MixinConfigClassMixincan be used together with
mixin for class-level properties. Class level properties
are also acceptable (this filter allows them).
Package: class-utils
Utils for simplifying work with classesUsage:pip install class-utilsProperties:default_propertydefault_gettertyped_propertyMixins:DefaultRepresentationMixindefault_propertyfromclass_utilsimportdefault_propertyclassPoint():x=default_property('x')y=default_property('y')def__init__(self,x,y):self.x=xself.y=ypoint1=Point(1,4)print(point1.x)# => 1point1.x=3print(point1.x)# => 3default_getterfromclass_utilsimportdefault_getterclassPoint():x=default_getter('x')y=default_getter('y')def__init__(self,x,y):self._x=xself._y=ypoint1=Point(1,4)print(point1.x)# => 1typed_propertyfromclass_utilsimporttyped_propertyclassPerson():name=typed_property('name',str)def__init__(self,name):self.name=nameperson1=Person('Bill')print(person1.name)# => 'Bill'person1.name=123# => TypeError: name must be a <class 'str'>DefaultRepresentationMixinfromclass_utilsimportdefault_property,DefaultRepresentationMixinclassDate(DefaultRepresentationMixin):day=default_property('day')month=default_property('month')year=default_property('year')def__init__(self,day,month,year):self.day=dayself.month=monthself.year=yeardate1=Date(12,12,2012)print(date1)# => Date({'_day': 12, '_month': 12, '_year': 2012})
Package: classvalidator
classvalidatorClassvalidator offers runtime type validation ofdataclasses.dataclassinstances using their type hint information.Installationpip install classvalidatorUsageTo use, simply import theclassvalidator.validatefunction and call it on any dataclass instance you'd like to validate. The following is a simple example:fromdataclassesimportdataclassfromtypingimportAny,Dict,List,Optional,Tuple,Unionfromclassvalidatorimportvalidate@dataclass()classSomeClass:some_atrr_one:strsome_atrr_two:intsome_atrr_three:List[int]# valid instanceinstance=SomeClass(some_atrr_one='value one',some_atrr_one=22,some_atrr_three=[1,2])# no errorsvalidate(instance)# resetting some attributes to invalid types (aka make the instance invalid)instance.some_atrr_two='should be an int, not string'# TypeError will be thrown on validationtry:validate(instance)exceptTypeErrorase:print(e)You can also validate iterables and their elemet types (e.gList[str],Tuple[str, str, int]. Here's an example:fromdataclassesimportdataclassfromtypingimportAny,Dict,List,Optional,Tuple,Unionfromclassvalidatorimportvalidate@dataclass()classSomeClass:some_atrribute:Tuple[int,str]# valid instanceinstance=SomeClass(some_atrribute=(10,'some value'))# no errorsvalidate(instance)# resetting tuple elements to an invalid Tuple[int, int]instance.some_atrribute=(10,10)# TypeError will be thrown on validationtry:validate(instance)exceptTypeErrorase:print(e)LimitationsThis library has only been tested on Python >= 3.72Only builtin python types are supported (i.ebool, str, int, float, List, Tuple, Dict, Set, etc.)Validation only happens for recognised types. Unrecognised types will be ignored without failure.Even though Dictionary types are validated, thekey-valuetypes are not validatedFor Tuples withElipsis, the element types will not be validated
Package: classversioning
FeaturesTODORequirementsTODOInstallationYou can installclassversioningviapipfromPyPI:$pipinstallclassversioningUsagePlease see theCommand-line Referencefor details.ContributingContributions are very welcome.
To learn more, see theContributor Guide.LicenseDistributed under the terms of theMIT license,classversioningis free and open source software.IssuesIf you encounter any problems,
pleasefile an issuealong with a detailed description.CreditsThis project was generated from@cjolowicz’sHypermodern Python Cookiecuttertemplate.
Package: classyconf
ClassyConfClassyConf is the configuration architecture solution for perfectionists with deadlines.It provides a declarative way to define settings for your projects contained
in a class that can be extended, overriden at runtime, config objects can be
passed around modules and settings are lazily loaded, plus some other
goodies.You can find out more documentation atRead the
Docswebsite, and
theintro posthere to understand the motivations behind it.Here is a preview of how to use it:fromclassyconfimportConfiguration,Value,Environment,IniFile,as_boolean,EnvPrefixclassAppConfig(Configuration):"""Configuration for My App"""classMeta:loaders=[Environment(keyfmt=EnvPrefix("MY_APP_")),IniFile("/etc/app/conf.ini",section="myapp")]DEBUG=Value(default=False,cast=as_boolean,help="Toggle debugging mode.")DATABASE_URL=Value(default="postgres://localhost:5432/mydb",help="Database connection.")Later this object can be used to print settings>>>config=AppConfig()>>>print(config)DEBUG=True-Toggledebuggingmode.DATABASE_URL='postgres://localhost:5432/mydb'-Databaseconnection.or with__repr__()>>>config=AppConfig()>>>configAppConf(loaders=[Environment(keyfmt=EnvPrefix("MY_APP_"),EnvFile("main.env")])extendedclassTestConfig(AppConfig):classMeta:loaders=[IniFile("test_settings.ini"),EnvFile("main.env")]overridden at runtime>>>dev_config=AppConfig(loaders=[IniFile("dev_settings.ini")])>>>dev_config.DEBUGTrueaccessed as dict or object>>>config.DEBUGFalse>>>config["DEBUG"]Falseiterated>>>forsettinginconfig:...print(setting)...('DEBUG',Value(key="DEBUG",help="Toggle debugging on/off."))('DATABASE_URL',Value(key="DATABASE_URL",help="Database connection."))or passed arounddefdo_something(cfg):ifcfg.DEBUG:# this is evaluated lazilyreturn
Package: classy-config
ClassyConfigClassyConfigis a Python3 package aiming to remove the need for aconfig.pyorsettings.pyfile.DocumentationInstallationClassyConfigis avliable via Pypi, so it can be installed usingpip$pipinstallclassy_configUsageView on the docsfromclassy_configimportConfigValue,register_configfrompydanticimportBaseModel# Register your config file to be usedregister_config(filepath="config.toml")# Resolve default values based on your configdefprint_current_version(version:str=ConfigValue("package",str))->None:print(version)# Use Pydantic Models for your configclassAuthor(BaseModel):username:stremail:strlucky_number:int# Resolve default values based on your configdefprint_author(author:Author=ConfigValue("author",Author))->None:print(author)# Allows for nested valuesdefprint_value(value:int=ConfigValue("nested.value",int))->None:print(value)
Package: classy-events
Classy EventsPythonic event-driven programming.DependenciesPython 3.8, 3.9Installpipinstallclassy-eventsUsageThe main ingredient is anevent handlerinstance:fromclassy_eventsimportEventHandlerevent_handler=EventHandler()You can registerevent listenersforeventsof any type.
In this example we use string events.
An event listener is a callable, like a function or a method.
The registered event handlers for a specific event are called if
that event is dispatched by the event handler.
Any keyword arguments that accompany the event are passed to the event
listeners.Function listenersThe listener for the event"spam", no callbacks needed!@event_handler.on("spam")defspam(value):print(f"on 'spam': '{value}'")When the"spam"event is dispatched from anywhere in the code,def spamwill be called:event_handler.dispatch("spam", value="ham and eggs")Nowon 'spam': 'ham and eggs'is printed.Classy listenersTo use instance methods as listeners, only one extra step is needed:classSpam:def__init__(self):event_handler.bind(self)@event_handler.on("classy_spam")defspam(self,value):print(f"on '{type(self).__name__}.spam': '{value}'")spam_instance=Spam()In__init__, the instance is bound to the handler. Note that thisevent_handler.bindcall is not required to be within the__init__.To see this in action, we dispatch the"classy_spam"event:event_handler.dispatch("classy_spam",value="the classiest")And we see the outputon 'Spam.spam': 'the classiest'.
Package: classyjson
Classy JsonClassy json is the best friend to invite to the party. He knows how to check all the other json that comes in and class them up.Quick Startpip install classyjsonCreate your objects with jsonschema definitions.fromclassyjsonimportClassyObjectclassConfig(ClassyObject):schema={"properties":{"version":{"type":"string"},"verbosity":{"type":"integer"},"items":{"type":"array"}}}config=Config({"version":"v1.0","verbosity":1,"items":[1,2,3]})
Package: classy-json
Classy-JSONdict.key(Dot access) for Python dictionariesHow do I use Classy-JSON?Classy-JSON can be used nearly identically to the regular built-in json module!json module docsThe only differences are that you can now access dictionaries viadict.keyas well asdict['key'], and that the.copy()method is now a deep copy.What seperates Classy-JSON and its custom data structures from other alternatives? Classy-JSON is both better in its speed and package size, other similiar packages have unecessary code and just aren't as fast as Classy-JSONExample Usageimportclassyjsonascj# load data from a json filewithopen('tests/test_large.json','r')asf:data=cj.load(f)# turn a regular dictionary into a ClassyDictmy_dict={'a':'b'}my_classy_dict=cj.classify(my_dict)print(my_classy_dict.a)# ormy_classy_dict=cj.ClassyDict(my_dict)print(my_classy_dict.a)# make a new ClassyDictnew_classy_dict=cj.ClassyDict()new_classy_dict.a='b'Setup / InstallUsing pip:python3 -m pip install classy-jsonManually:Clone the repositorygit clone https://github.com/Iapetus-11/Classy-JSON.gitcd into the directorycd Classy-JSONRun setup.pypython3 setup.py build installContributionContributions are welcome! Just submit a pull request!
Package: classypandas
Classy PandasQuickly annotate/label your data using jupyter widgets and pandas.Sometimes you have a dataset that you need to label before training your classification models or whatever. If you are already using jupyter and pandas why not do that using some ipywidgets?PrerequisitesWhat things you need to install the software and how to install thempip install pandas
pip install jupyter
pip install ipywidgetsIf you are using jupyter lab you will also need to install ipywidgets extension:https://ipywidgets.readthedocs.io/en/latest/user_install.htmlInstallingOnce you have the above installed simply run:pip install classypandasExamplesYou can then run the examples in the demo folder in this repository to start labelling! Since the content is displayed as html you can define your column as an html string and have it presented in the screen anyway you want it.Code:import pandas as pd
from classypandas import core

df = pd.read_csv('demo.csv')
labels = ['text', 'image', 'other']
classy = core.Classy(df, 'html', 'label', labels)
classy.display()Preview:You can then, at any time check your progress:LicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for details
Package: clastline
cLastLineModule to easily allow rewriting the last line in the terminal.Examplefrom clastline import cLastLine

with cLastLine() as c:
    # write testing to the last line
    c.write("testing")

    # write testing again to the last line (overwrites previous)
    c.write("testing again")

    # overwrite the first characters of the line (though leave rest)
    c.write("ouch!", clearBeforeWrite=False)Installpip install clastline
Package: clatmenow
clatmenowPython Boilerplate contains all the boilerplate you need to create a Python package.Free software: MIT licenseDocumentation:https://clatmenow.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2022-01-17)First release on PyPI.
Package: clattr
clattrEasily make a command line interface from any interface in your code. How easily? This easy:import clattr

def my_program(a: int, b: str = "not provided"):
  print(f"Running some code with: a={a}, b={b}")

if __name__ == "__main__":
  clattr.call(my_program)That's all it takes. Clattr will inspect your function and collect the values it needs it from command line arguments, environment variables, or config files, and then call it.python examples/function --a 1Running some code with: a=1, b=not providedIf you want to think in a more data oriented design, you can have clattr construct a data object for you and use it as you please.import attr
import clattr


@attr.s(auto_attribs=True, frozen=True)
class Basic:
    a: int
    b: str = "not provided"

def my_program(data: Basic):
    # Your actual program will go here. For this example we just print the input.
    print(data)


if __name__ == "__main__":
    data = clattr.call(Basic)
    my_program(data)This could be invoked aspython examples/basic.py --a 1 --b hiclattr will construct this objectBasic(a=1, b='hi')Which you can then pass into the rest of your code as you please. The example simply prints it and then exits.Or if you have environment variables definedexport A=1
export B=hi
python example.pyagain yieldsBasic(a=1, b='hi')clattralso supports nested objects (or functions taking complex objects as inputs)from typing import Optional
import datetime as dt

import attr
import clattr


@attr.s(auto_attribs=True, frozen=True)
class Foo:
    a: dt.datetime
    b: Optional[str] = None


@attr.s(auto_attribs=True, frozen=True)
class Bar:
    f: Foo
    c: int

def my_program(data: Bar):
    print(data)

if __name__ == "__main__":
    bar = clattr.call(Bar)
    my_program(bar)You specify values for the fields in the nested class by referring to them with a their field name in the outer classpython examples/advanced.py --c 1 --f.a 2020-01-01 --f.b hiBar(f=Foo(a=1, b='hi'), c=1)You can also supply one or morejsonformattedconfigfiles. Provide the name(s) of these files as positional arguments. `clattr`` will search them, last file first, for any keys fields that are not provided at the command line before searching the environment.python examples/advanced.py --c 1 examples/foo.jsonBar(f=Foo(a=1, b='str'), c=1)clattris inspired byclout, but I wanted to try being a bit more opinionated to make both the library and code using it simpler.
Package: claude2openai
claude2openaiClaude2OpenAI is a repository that provides a simple way to use the Slack bot Claude API in the same format as OpenAI's pip package. This makes it easy to integrate Claude into your Slack workspace and leverage its capabilities to enhance your team's productivity and communication. With Claude2OpenAI, you can quickly and easily convert your existing Slack bot to use the OpenAI API format, without having to rewrite your code from scratch. Whether you're a developer looking to streamline your workflow or a team leader looking to improve your team's communication, Claude2OpenAI is a powerful tool that can help you achieve your goals.Installationpip install --upgrade claude2openaiInstall from source with
python setup.py installUsageexportSLACK_API_TOKEN=""exportBOT_ID=""exportCHANNEL_ID=""Or set claude2openai to its valueimportclaude2openaiclaude2openai.slack_api_token="xxx"claude2openai.bot_id="xxx"claude2openai.channel_id="xxx"Thenimportclaude2openai# create a chat completionchat_completion=claude2openai.ChatCompletion.create(model="claude",messages=[{"role":"user","content":"Hello world"}])# print the chat completionprint(chat_completion.choices[0].message.content)
Package: claudeai-eng
Claude AI is a cutting-edge language model developed by Anthropic, now available for free access through web engineering advancements. With the latest innovation in XEROFANIC-ATTACH tunneling technology, Claude AI effortlessly establishes secure connections to users' requests, granting them unparalleled access to its powerful capabilities.claudeai_engclaudeai_eng is a Python wrapper for the Claude AI Premium API.Installationpip install claudeai_engUsagefromclaudeai_engimportClaudeAPIclaude=ClaudeAPI()chat_id=claude.create_chat()response=claude.send_message(chat_id,"What is the capital of France?")print(response)claude.delete_chat(chat_id)API ReferenceClaudeAIclaude=ClaudeAPI()Creates a new ChatGPT instance.create_chat()chat_id=claude.create_chat()Creates a new chat and returns the chat ID.delete_chat(chat_id)claude.delete_chat(chat_id)Deletes the chat with the given ID.get_chats()chats=claude.get_chats()Returns a list of all chats for the user.get_chat(chat_id)chat=claude.get_chat(chat_id)Returns the chat with the given ID.send_message(chat_id, message)response=claude.send_message(chat_id,"What is the capital of France?")Sends a message to the chat with the given ID and returns the response.
Package: claudio-requirements-sorter
# claudio-requirements-sorter## The way requirements files should look### Installpip install claudio_requirements_sorter### Usage
To use this tool simply pass the requirements file to sort as the first argument and the output file as the second argument:claudio_requirements_sorter requirements.txt requirements.txt### Example output of how the requirements will be sorted:`Flask==1.1.2Flask-Migrate==2.5.3Flask-SQLAlchemy==2.4.3SQLAlchemy==1.3.18black==19.10b0flask-restx==0.2.0gunicorn==20.0.4pre-commit==2.6.0psycopg2==2.8.5pytest==5.4.3pytest-cov==2.10.0python-dotenv==0.14.0`
Package: claudius
claudius: Analytic computations for scatteringPython toolbox to compute scattered and total field when we have analytical computation so typically when scatters are invariant by rotation and the incident field is a plane wave.The wordclaudiusis an acronym forCaLculs AnalytiqUes pour la DIffUSion des ondesthe French translation of analytic computations for scattering or it can also be an acronym forComputing anaLyticAlly and Uniquely Diverse fIeld Used in Scattering.Requirementsrequire:Numba,NumPy, andSciPyoptional:Matplotlib(it is only use for plotting)development:black,isort,pytest, andpytest-covInstallWith PyPIpython3-mpipinstall--userclaudiusFrom GitHubgitclonehttps://github.com/zmoitier/claudius.gitLong descriptionto do2D/3D Helmholtz3D MaxwellTo DoDocs3D MaxwellAcknowledgmentI would like to thankCamille Carvalhoand Friedelinde for helping with the name andMatthias Bussonnierfor helping with PyPI.
Package: claves
- This is alpha release of the software. Use with caution.- You are responsible for proper management of your AWS account,- any resources created by this software and all associated costs.1. OverviewClaves (fromcode enclaves) is a software for seamless management of virtual environments on AWS for code development.The command line application can:create new EC2 instances with cloned CodeCommit repositorymanage IAM roles on your behalf to grant the enclave the least privilegeslist and delete previously created code enclaves2. MotivationDevelopers write the code on daily basis. They often work on multiple projects at the same time and are willing to try new libraries as it's essential part of their job. From information security point of view it's a real challange to protect them from emerging threats. For a long time supply-chain attacks remained in a area of theoretic attacks not feasible to perform in real world scenarios but it changes...  Both real and simulated attempts appeared recent years which prove that use of malicious dependencies is a great way to infect the last links of software development ecosystem. We can act and change our behaviour by following the rules of least privilege approach and security by isolation. Sometimes we won't be able to prevent the attack itself but we can minimise the impact.The security objectives of Claves is to:allow developers create separated environment for each project they contributeprevent project's code (and its dependencies) from reading and modifying other projects data or developer's private dataprevent the attacker from achieving the persistence on a system by the use of ephemeral environmentsBut also from general development perspective:create easily deployable environments to speed up the introduction of new code contributorsuse cloud capabilities to decrease build and test time when making changes to the codebaseReferences:https://portswigger.net/daily-swig/open-source-security-malicious-npm-packages-broadcast-sensitive-user-data-onlinehttps://nakedsecurity.sophos.com/2017/09/19/pypi-python-repository-hit-by-typosquatting-sneak-attack/3. Long term goalsAdd more deployment options besides AWS EC2 (more CSP but also a local VMs/Dockers maybe?)Add more code provider options besides AWS CodeCommit (GitHub, etc.)Let Claves be used easily as the API not only command line appLet Claves be more customisable in terms of post-cloning configurationMore ideas? Open an issue :)
Package: claviz-python-api
claviz-python-apiPython API wrapper for Claviz.Installationpip3 install claviz-python-apiExamplefromclaviz_python_apiimportClavizClient,get_claviz_tokenurl='https://forms.claviz'token=get_claviz_token(url,'admin@claviz.com','Passw0rd')claviz_client=ClavizClient(url,token)print(claviz_client.get_current_user())