Saravanan666/pypi-org huggingface dataset:
Package: tomlcheck
A simple toml syntax checker.Designed to be used bypre-commithooks.Installationpipinstall-UtomlcheckUsageCheck files:tomlcheck$(find.-typef-name"*.toml")# Or read from stdinfind.-typef-name"*.toml"|tomlcheck-With logging:tomlcheck--log-levelDEBUG$(find.-typef-name"*.toml")# Or read from stdinfind.-typef-name"*.toml"|tomlcheck--log-levelDEBUG-Inpre-commitconfig:# .pre-commit-config.yaml-repo:localhooks:-id:tomlcheckname:Check TOML Syntaxdescription:Checks TOML files for valid syntax.entry:tomlchecklanguage:systemfiles:\**/*.toml$stages:[commit,push,manual]Help Menutomlcheck--help
Package: toml-cli
tom-cliCommand line interface for toml files.This can be usefull for getting or setting parts of a toml file without an editor.
Which can be convinient when values have to be read by a script for example in
continuous development steps.Installpip install toml-cliGet a valuetoml get --toml-path pyproject.toml tool.poetry.nametoml get --toml-path pyproject.toml tool.poetry.authors[0]Set a valuetoml set --toml-path pyproject.toml tool.poetry.version 0.2.0Add a sectiontoml add_section --toml-path pyproject.toml tool.poetry.new_sectionUnset a valuetoml unset --toml-path pyproject.toml tool.poetry.version
Package: tomlconfig
English |简体中文tomlconfigToml configparser made (stupidly) simple for python.installpipinstalltomlconfigUsageDefine the toml config file "config.toml" as following:[general]
language = 'en'

[general.editor]
size = 12
font = 'arial'TomlConfig parse it very simply:fromtomlconfigimportTomlConfig# read config fileconfig=TomlConfig("config.toml")# get itemlanguage=config["general.language"]# "en"size=config["general.editor.size"]# 12# in operation"general.language"inconfig# True"config.hasSec("general")# Trueconfig.hasSec("general.language")#False# set itemconfig["general.editor.font"]="Roman"# set font=Roman in toml# add itemconfig["server.name"]='server1'# add a new itemconfig["newSection"]={"k1":1}# add a new config section# delete itemdelconfig["server.name"]# list item operationconfig.insertToChild("general.editor.font",0,"Arial")# change font from str to list and insert itemconfig.appendToChild("general.editor.font","SimSun")# font=["Arial", "Roman", "SimSun"]# same as config["general.editor.file"].append("SimSun")# saveconfig.save()# saveasconfig.save("newfile.toml")
Package: toml-config
toml_configPython library that simplifies parsing and creating Toml configuration files.
Wrapper ontomlinstallationTo install a module run the command:pip install toml_configUsingTo get started, import the module. Create an instance of the Config class
by passing as a parameter the path to an existing file or the path where this file
will be created.And then you can read parameters from the file and write parameters to the file.Example.
Creating a file and writing values.main.py:fromtoml_config.coreimportConfigmy_config=Config('app.config.toml')my_config.add_section('app').set(key='value',other_key=[1,2,3])app.config.toml:[app]key="value"other_key=[1,2,3,]
Package: tomlenv
TOMLenvEnvironment wrapped TOML.Package available inPyPI.Getting StartedInstall the libraryUsing pip:$pipinstalltomlenvUsing pipenv:$pipenvinstalltomlenvUsing poetry:$poetryaddtomlenvBasic UsageTomlenv takes advantage of modern Python features such asdataclassesandtomllibto create a simple yet powerful configuration library.By default, tomlenv looks for aconfig.tomlfile in your project root:token="dev"debug=falseAssuming this environment variable is set:TOMLENV_DEBUG=trueCreate your configuration dataclass and parse config and env into it:importtomlenvfromdataclassesimportdataclass@dataclassclassConfig:token:str=''debug:bool=Falseconfig=Config()parser=tomlenv.Parser()parser.load(config)# You can now access the fields of your fully typed config Class# that contains values from a TOML config file and the environment.# For example:token=config.tokendebug=config.debugprint(token)# prints "dev"print(debug)# prints TrueConfigurationTo configure the location of your toml file, setTOMLENV_CONF_FILEPATH.For example if your config file is inconfigs/config.tomlrelative to the project root, then setTOMLENV_CONF_FILEPATH=configs/config.tomlTestsThis project usesPoetryandGNU Make.Run tests from the project root with:$maketestTo get a coverage report:$makecovIssuesFeel free to send issues or suggestions tohttps://github.com/joaonsantos/tomlenv/issues.
Package: toml-env-conf
toml-env-confpip install toml-env-confA minimal library for environment-specific (dev/prod) application configuration using TOMLUseful if you want different values in some environments (local/test/prod). e.g. all environments use
the values base_conf.toml, but you only want some values to be different whenenv == "prod"As easy asimporttoml_env_conftoml_env_conf.load_as_dict(path)# ortoml_env_conf.load_as_dataclass(path=path,data_class=MyConfigType,env="prod")Where the path has the following toml files├── base_conf.toml
└── env_prod.tomlConventionTheremustbe a file namedbase_conf.tomlFor environment overrides, the file must be calledenv_[name].tomle.g. for an environment calledprod, the file is calledenv_prod.toml.
For an environment calleddev, the file is calledenv_dev.toml.ExampleStep 1: Create some configsbase_conf.tomlname="Regular name"hobby_name="laundry"is_fun=falsescores=[-10,-20]env_prod.tomlhobby_name="music"is_fun=trueStep 2: Load em upmain.pyfromdataclassesimportdataclassfrompathlibimportPathfromtypingimportListimporttoml_env_conf@dataclass(frozen=True)# freeze for immutabilityclassMyConfigType:name:strhobby_name:stris_fun:boolscores:List[int]if__name__=="__main__":conf_dir_path=Path(__file__).parent.joinpath("/path/to/config")config:MyConfigType=toml_env_conf.load_as_dataclass(conf_dir_path,MyConfigType,env="prod")print(config)
Package: tomler
A simple reader for configuration file with TOML syntax.UsageAt first, import the module as followsfrom tomler import ConfigAfter that, you can call for the first time the configuration file as followsconfig = Config('<path to the configuration file>', [True | False])The second parameter is optional. It activates (or deactivates) the hot
reloading of the configuration file each time a value is accessed.The classConfigimplements the singleton pattern.A value is accessed similarly a dictionary, in particular as followsval = config["key_1/key_2/.../key_N"]
Package: tomlev
TomlEv - Open-source Python framework to manage environment variablesMotivationto be filled later...Install# pippipinstalltomlev# poetrypoetryaddtomlevBasic usageto be filled later...Strict modeto be filled later...Supportif you likeTomlEvgive it a start ⭐https://github.com/thesimj/tomlevLicenseMIT licensed. See theLICENSEfile for more details.
Package: toml-file
TOML file reader - python module to read/write toml configuration filesFiles can be loaded and saved completed with comments and formatingConfiguration files can be templated and values validated on load or value changesTwo interaces:Simple dictionaries {key: value}data dictionary with nested dictionary with {key: value}template dictionary with comments/type informationtemplate allows type, min/max  and other validators to be set and stores
commentsuse load/save functions to open/save to file.Config object interface:allows seamless use of template/data via custom dictlike interfaceuse cfg = Config(filename) to openaccess subtables/keys via exteneded key indexing e.g. cfg[‘Table1.subtable.key’] = 1if a template has been set any value will be validated when it is set.if a template has been set any missing values will return the defualt and be created.use cfg.save(filename) to save
Package: tomlguard
TomlGuardAuthor: John Grey
Date  : 2022-12-06OverviewA Python Toml wrapper to make things a bit less annoying.ExamplesWith some toml:[person]name="bob"age=26friends=["bill","jill","jim"]importpathlibasplimporttomlguardasTGdata=TG.load("basic.toml")# Or load all tomls concatenated together:# data = TG.load_dir(pl.Path())print(data.person.name)# -> bobprint(data.person.age)# -> 26print(data.person.friends)# -> ["bill", "jill", "jim"]print(data.on_fail("Fallback",str).this.doesnt.exist())# -> "Fallback"print(data.on_fail("bill?").person.name())# -> bobtry:print(data.on_fail("a string",str).person.age())exceptTypeError:print("Type Mismatch")print(TG.TomlGuard.report_defaulted())# -> ['this.doesnt.exist = "Fallback" # <str>']# TODO: explain all_of, any_of, match_on for multi-tables
Package: tomlini
TOMLiniA minimal, unintrusive library that allows you to add the ability to initialize an object from a TOML file without having to go through the dictionary dance.InstallAvailable on PyPIpipinstalltomliniExampleAll you need to do is create your class with the@toml_initdecorator:# myclass.py@toml_initclassMyClass:def__init__(v1,v2):self.v1=v1self.v2=v2@toml_initclassMyClass2:def__init__(v3,v4:MyClass):self.v3=v3self.v4=v4Define your TOML file (make sure the TOML key names match the__init__parameter names!):# file1.tomlv1="aaa"v2=1# file2.tomlv3=[1,2,3][v4]v1="aaa"v2=1And you're off to the races!frommyclassimportMyClass,MyClass2my_class=MyClass.load_from_toml("/path/to/file1.toml")my_class_2=MyClass2.load_from_toml("/path/to/file2.toml")print(my_class.v1,my_class.v2)# Outputs: 'aaa', 1print(my_class_2.v4.v1)# Outputs: 'aaa'
Package: tomli-w
Tomli-WA lil' TOML writerTable of Contentsgenerated withmdformat-tocIntroInstallationUsageWrite to stringWrite to fileFAQDoes Tomli-W sort the document?Does Tomli-W support writing documents with comments or custom whitespace?Why does Tomli-W not write a multi-line string if the string value contains newlines?Is Tomli-W output guaranteed to be valid TOML?IntroTomli-W is a Python library for writingTOML.
It is a write-only counterpart toTomli,
which is a read-only TOML parser.
Tomli-W is fully compatible withTOML v1.0.0.Installationpipinstalltomli-wUsageWrite to stringimporttomli_wdoc={"table":{"nested":{},"val3":3},"val2":2,"val1":1}expected_toml="""\val2 = 2val1 = 1[table]val3 = 3[table.nested]"""asserttomli_w.dumps(doc)==expected_tomlWrite to fileimporttomli_wdoc={"one":1,"two":2,"pi":3}withopen("path_to_file/conf.toml","wb")asf:tomli_w.dump(doc,f)FAQDoes Tomli-W sort the document?No, but it respects sort order of the input data,
so one could sort the content of thedict(recursively) before callingtomli_w.dumps.Does Tomli-W support writing documents with comments or custom whitespace?No.Why does Tomli-W not write a multi-line string if the string value contains newlines?This default was chosen to achieve lossless parse/write round-trips.TOML strings can contain newlines where exact bytes matter, e.g.s="here's a newline\r\n"TOML strings also can contain newlines where exact byte representation is not relevant, e.g.s="""here's a newline"""A parse/write round-trip that converts the former example to the latter does not preserve the original newline byte sequence.
This is why Tomli-W avoids writing multi-line strings.A keyword argument is provided for users who do not need newline bytes to be preserved:importtomli_wdoc={"s":"here's a newline\r\n"}expected_toml='''\s = """here's a newline"""'''asserttomli_w.dumps(doc,multiline_strings=True)==expected_tomlIs Tomli-W output guaranteed to be valid TOML?No.
If there's a chance that your input data is bad and you need output validation,
parse the output string once withtomli.loads.
If the parse is successful (does not raisetomli.TOMLDecodeError) then the string is valid TOML.
Package: tomlkit
TOML Kit - Style-preserving TOML library for PythonTOML Kit is a1.0.0-compliantTOMLlibrary.It includes a parser that preserves all comments, indentations, whitespace and internal element ordering,
and makes them accessible and editable via an intuitive API.You can also create new TOML documents from scratch using the provided helpers.Part of the implementation has been adapted, improved and fixed fromMolten.UsageSee thedocumentationfor more information.InstallationIf you are usingPoetry,
addtomlkitto yourpyproject.tomlfile by using:poetryaddtomlkitIf not, you can usepip:pipinstalltomlkitRunning testsPlease clone the repo with submodules with the following commandgit clone --recurse-submodules https://github.com/sdispater/tomlkit.git.
We need the submodule -toml-testfor running the tests.You can run the tests withpoetry run pytest -q tests
Package: toml-package
Package using pyproject.tomlThe publisher is using the latest version of setuptoolsThe latest version of twine is used to upload the packageThe user installing the package has at least Pip 9.0, or a client that supports the Metadata 1.2 specification.Creating the package filespackaging_tutorial/
├── LICENSE
├── pyproject.toml
├── README.md
├── src/
│   └── your_package/
│       ├── __init__.py
│       └── example.py
└── tests/Dealing with the universal wheelsTraditionally, projects providing Python code that is semantically compatible with both Python 2 and Python 3, produce wheels that have a py2.py3 tag in their names.It is often configured within setup.cfg under the [bdist_wheel] section by setting universal = 1 if they use setuptools.Choosing a build backendTools like pip and build do not actually convert your sources into a distribution package (like a wheel); that job is performed by a build backend.The build backend determines how your project will specify its configuration, including metadata (information about the project, for example, the name and tags that are displayed on PyPI) and input files.Build backends have different levels of functionality, such as whether they support building extension modules, and you should choose one that suits your needs and preferences.HatchlingsetuptoolsFlitPDMothers that support the [project] table for metadata.
The pyproject.toml tells build frontend tools like pip and build which backend to use for your project.Defining the Python version requiredpython3 -m pip install --upgrade setuptools twineGenerating distribution archivespython3 -m pip install --upgrade build

python3 -m buildUploading the distribution archivespython3 -m pip install --upgrade twine
python3 -m twine upload --repository pypi dist/*Installing your newly uploaded packagepython3 -m pip install toml_package
Package: tomlpatch
tomlpatchDo you want to patch your toml file structurally like modifying a nested python dictionary? This is a tool for you.DescriptionSometimes, you want to edit/patch a toml file, but you don't want to use thediffbetween two source files to patch the toml file since it may introduce conflicts that requires human intervention to resolve.
For example,Cargo.tomlis used by Rust projects, and this tool can be used to patch theCargo.tomlfile with an external JSON file that contains the structural patch information so that you don't need to manually resolve theCargo.tomlfile.Installationpip install tomlpatchUsagetomlpatch original_toml_file patch_json_fileExampleSuppose you have aCargo.tomlfile like this:[package]name="my_package"version="0.0.1"liberssl={version="0.10.42",default-features=false,features=["vendered"]}sources=["s1","s2"]targets=["t1","t2","t3"]And you want to patch theCargo.tomlfile with a JSON file like this:{"patch":{"package.version":"0.0.2","package.liberssl.features":null},"extend":{"package.sources":["s4","s5"]},"remove":{"package.targets":["t2"]}}Then you can use the following command to patch theCargo.tomlfile:tomlpatch Cargo.toml patch.jsonAfter the patch, theCargo.tomlfile will be like this:[package]name="my_package"version="0.0.2"sources=["s1","s2","s4","s5",]targets=["t1","t3",][package.liberssl]version="0.10.42"default-features=falseTODOSwitch totomkitfor style preserving patching
Package: tomlq
tomlqA Python wrapper for yq exposing the toml functionalityFree software: MIT licenseDocumentation:https://tomlq.readthedocs.io.FeaturesVery simple wrapper layer exposing existing tomlq functionality.CreditsThis package was created withCookiecutterand thecmeister2/cookiecutter-pypackageproject template.ChangelogAll notable changes to this project will be documented in this file.The format is based onKeep a Changelog,
and this project adheres toSemantic Versioning.UnreleasedChanged0.1.0- 2019-05-31AddedFirst release on PyPI.
Package: tom-lt
Liverpool Telescope facility module for the TOM Toolkit v0.4.0FeaturesThis module addsLiverpool Telescopesupport
to the TOM Toolkit.The module implements an RTML (Remote Telescope Markup Language) payload which
is sent directly to the Liverpool Telescope. Using this module TOMs can submit
observations to the Liverpool Telescope Phase 2 system. In order to modify or
delete observations, users will need to log in and use the current Phase 2 tool.Currently supported instrumentsIO:OIO:ISPRATFRODOspecCurrent feature setSetting a window using Flexible time constraintControl of all observing constraints (Airmass, Seeing, SkyBrightness)Multiband photometry with full IO:O filter setAutomatic Autoguider usage setting based on exposure timeAutomatic Target Acquisition for SPRAT and FRODOspec instrumentsParalactic Angled slit orientation for SPRATAutomantic Xe Arc calibration frame for SPRATUnsupported functionalityAdvanced Time constraints (Monitor, Phased, Min. Interval, Fixed)Control of Autoguider optionsPerforming multiple instrument observations in one scheduled GroupDefocussing or manual dither / offset patternsManual Cassegrain rotation to achieve specific sky anglesMore specific aquisition routines for SPRAT or FRODOspecFuture extentions to the module will enable, in order of planned implementation;Cancelling of previously submitted observationsChecking of an observations status and whether dataproducts are readyAbility to pull dataproducts directly into the TOMToolkit for reductionInstallation and Setup:Install the module into your TOM environment:pipinstalltom-ltAddtom_lt.lt.LTFacilityto theTOM_FACILITY_CLASSESin your TOM'ssettings.py:TOM_FACILITY_CLASSES=['tom_observations.facilities.lco.LCOFacility',...'tom_lt.lt.LTFacility',]Include the following settings inside theFACILITIESdictionary insidesettings.py:FACILITIES={...'LT':{'proposalIDs':(('ProposalID','Display Name'),('ProposalID','Display Name')),'username':'','password':'','LT_HOST':'','LT_PORT':'','DEBUG':False,},}The proposalIDs key contains a list of proposalIds and the Display name in the TOM Toolkit LT submission form. For one proposal, use a single element list (e.g.'proposalIDs': (('ProposalID', 'Display Name'),)The Liverpool Telescope team will need to enable RTML access for the proposal (or proposals)
being used. Please emailltsupport_astronomer@ljmu.ac.uk, providing details
of your active proposal. Once the proposal is enabled for RTML access, we will email you back user
credentials and the required IP Address / Port for connection to the telescope.Please refrain from publishing your user credentials, or the LT IP Address to
any public github account
Package: toml-to-requirements
TOML to RequirementsSimple script to convert a pyproject.toml file to a requirements.txt file.Does not support poetry projects! They have their own converter tools.InstallationInstall with pip:pipinstalltoml-to-requirementsUsageRun the following command to generate a requirements.txt file without including optional dependencies:toml-to-req--toml-filepyproject.tomlTo include optional dependencies, include the--include-optionalflag in the above command:toml-to-req--toml-filepyproject.toml--include-optionalThe optional lists to include can also be specifiedtoml-to-req--toml-filepyproject.toml--include-optional--optional-listsdev,test
Package: toml-validator
MAINTAINER NEEDED: this project is complete but won’t be updated until further notice. If you have interest in improving it, please contact me by creating anissue here.FeaturesCLI fortomlkit.RequirementsYou need Python 3.7.0 or above (latest 3.9 recommended) installed on your machine.InstallationYou can installTOML ValidatorviapipfromPyPI:$pipinstalltoml-validatorUsage$toml-validatorFILAPATH1FILEPATH2...It gives a green message for correct files and red message with errors.ContributingContributions are very welcome.
To learn more, see theContributor Guide.LicenseDistributed under the terms of theMITlicense,TOML Validatoris 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: tom-nonsidereal-airmass
Nonsidereal Target Airmass TOM ModuleThis module adds support to generate nonsidereal airmass plots
to the TOM Toolkit.Installation:Install the module into your TOM environment:pip install tom-nonsidereal-airmassIn your TOM'ssettings.py, add this toINSTALLED_APPS:...
'tom_nonsidereal_airmass',If you have already customized yourtarget_detail.htmltemplate you can skip ahead to "At the top of the file."cdinto thetemplatesdirectory in the main directory of
your project. Make a directory calledtom_targetsandcdinto it.Now you need to find where pip installed thetomtoolkitin the virtual environment you use for your TOM. If you don't remember
where that is, you can dopip show tomtoolkitand theLocationwill tell you where it is.
Copy the following file into yourtemplates/tom_targetsdir:{tomtoolkit location}/tom_targets/templates/tom_targets/target_detail.htmlAt the top of the file (I put it after the first{% load %}),
paste the following line{% load nonsidereal_airmass_extras %}Then to actually display the plots, find the line that says{% elif target.type == 'NON_SIDEREAL' %}and delete the next line with the<p>...</p>about not being able to plot non-sidereal airmass.
Change it to{% nonsidereal_target_plan %}And you're done!
Package: tomoco
Torch Model Compression(tomoco)This is a Deep Learning Pruning Package. This package allows you to prune layers of Convolution Layers based on L1 or L2 Norm.Tomoco PackagePackage install:pip install tomocoChannel Pruning based on Norm:from tomoco import pruner
import timm
from torchvision.datasets import CIFAR10
from torch.utils.data import DataLoader



class config:
    lr = 0.001 
    n_classes = 10			 # Intended for output classes
    epochs = 5                         # Set no. of training epochs
    device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")    # Pick the device availble
    batch_size = 64			# Set batch size
    optim = 0
    training =1                        # Set training to 1 if you would like to train post to prune
    criterion = nn.CrossEntropyLoss()  # Set your criterion here

train_dataset = CIFAR10(root='data/', download=True, transform=transforms.ToTensor())
valid_dataset = CIFAR10(root='data/',  download=True,train=False, transform=transforms.ToTensor())

# define the data loaders
train_loader = DataLoader(dataset=train_dataset, batch_size=config.batch_size, shuffle=True)
valid_loader = DataLoader(dataset=valid_dataset, batch_size=config.batch_size, shuffle=False)


#Use a cutom model or pull a model from a repository

res50 = timm.create_model("resnet50", pretrained=True).to(config.device)
config.optim =  torch.optim.Adam(res50.parameters(), config.lr=0.001,  amsgrad=True) 

pruner(res50,"res50", config, (3,64,64), "L1", 0.15,  train_loader, valid_loader)