Saravanan666/pypi-org huggingface dataset:
Package: arrdem.yamlschema
YAML SchemaA library that implements some amount of jsonschema validation against YAML document ASTs.Unlike other JSON-schema validation tools which give document path relative errors, this approach allows for line & file errors more appropriate to user-facing tools.
yamlschema(PyPi)(Github)(source)just loads the YAML document fully and punts directly to jsonschema; making it difficult-to-impossible to map errors back to source locations.API Overviewyamlschema.LintRecord(level, node, schema, message)LintRecords are what linting produces.
Each LintRecord contains the YAML AST node which failed validation, the schema it failed to validate against, and some metadata.levelis aLintLevelwhich attempts to explain what "kind" of error this piece of lint represents.
For instanceLintLevel.MISSINGencodes missingproperties.LintLevel.MISSMATCHencodes type mismatches.LintLevel.UNEXPECTEDencodes unexpected/disallowed keys and other errors.yamlschema.YamlLinter(schema)The linter itself is implemented as a class with a variety of instance methods; allowing the linter to be hacked by users much in the same way that JSON encodiers and decoders can be hacked.The linter "interface" consists of__init__(schema: dict); being a loaded JSON schema as a dict tree andlint_document(schema, node) -> Iterable[LintRecord]which initiates the recursive linting.The reference implementation of the linter recursively callslint_documenton every sub-structure in the document.yamlschema.lint_file(schema, path, cls=YamlLinter)As conveniences, yamlschema gives you a couple entrypoints that handle constructing the linter class, usingyaml.compose()to get an AST and starting linting for you.lint_fileandlint_bufferrespectively allow the user to either bring a file path or a string of YAML.Example>>> from yamlschema import lint_buffer
>>> list(lint_buffer({"type": "integer"}, "---\n1.0"))
[
  LintRecord(
    level=<LintLevel.MISSMATCH: 2>,
    node=ScalarNode(tag='tag:yaml.org,2002:float', value='1.0'),
    schema={'type': 'integer'},
    message="Expected an integer, got a 'tag:yaml.org,2002:float'"
  )
]
Package: arrebol
ArrebolPacote criado com a finalidade única de testar como subir um pacote para o PyPi e Conda.https://github.com/traquitanas/arrebolhttps://anaconda.org/michelmetran/arrebolhttps://pypi.org/project/arrebol/Build ManuallyInicialmente é necessário instalar oconda-buildcom o comando:condaactivatepablocarreira-py39
condainstallconda-buildUma vez instalado, é possível buildar com o comando abaixo:conda-build./conda/GitActionsHá umGitActionpara publicar pacotes no Conda. A vantagem é que ele converte obuildpara outras plataformas (adicionar converters)!Já tentei outros, porém abandonei por falhas:elbeejay/conda-publish-action@v1.5maxibor/conda-package-publish-action@v1.1# Convert Package to Other Platformscd~platforms=(osx-64linux-32linux-64win-32win-64)find$HOME/conda-bld/linux-64/-name*.tar.bz2|whilereadfiledoecho$file#conda convert --platform all $file  -o $HOME/conda-bld/forplatformin"${platforms[@]}"docondaconvert--platform$platform$file-o$HOME/conda-bld/donedoneReferênciasConda-Build: Conda channelsMedium: Publishing Your Python Package on conda and conda-forgeYouTube: Building and Distributing Python Software with CondaMedium: Building a conda package and uploading it to Anaconda CloudNão gostei pois é preciso etapas manuaisGitActionshttps://github.com/maxibor/conda-package-publish-actionhttps://github.com/rfun/tethysapp-servicetest/blob/master/.github/workflows/main.yml
Package: arrendatools.plantillas
ArrendaTools PlantillasMódulo de Python que aplica plantillas jinja. Además inlcuye filtros que pueden ser útiles a los arrendadores para la generación de recibos de alquiler, facturas, generar informes,...RequisitosEste módulo requiere Python 3.7 o superior.UsoA continuación se muestra un ejemplo de cómo usar el módulo:fromarrendatools.plantillas.plantillaimportaplicar_plantillaimportjsonplantilla="prueba.html"fichero_datos='prueba.json'withopen(fichero_datos,encoding='utf-8')asjson_file:data=json.load(json_file)doc=aplicar_plantilla("./",plantilla,data)withopen('prueba-rendered.html',"wb")asarchivo:archivo.write(doc.encode('utf-8'))
Package: arrest
ArrestDocumentation:https://s-bose.github.io/arrest/Enable data validation for REST APIs.Built on top of Pydantic and httpx.
Arrest is like a postman client for your microservice apis. It provides a simple layer of Pydantic encapsulation over Httpx HTTP calls to ensure structural integrity of your api definitions in a single file, as well as provide Pydantic's strength of data validation.InstallationpipinstallarrestGetting StartedfromarrestimportResource,Servicefromarrest.exceptionsimportArrestHTTPExceptionxyz_service=Service(name="xyz",url="http://www.xyz-service.default.local.cluster:80",resources=[Resource(route="/users",handlers=[("GET","/"),("GET","/{user_id:int}"),("POST","/")])])try:response=awaitxyz_service.users.get("/123")exceptArrestHTTPExceptionasexc:logging.warning(f"{exc.status_code}{exc.data}")
Package: arris-tg2492lg
Arris TG2492LG Python clientA unofficial Python client for retrieving information from the Arris TG2492LG router. The Arris TG2492LG is one of two routers that Ziggo, a cable operator in the Netherlands, provides to their customers as the Ziggo Connectbox.The current functionality is limited to retrieving a list of devices that are connected to the router.WARNING:The router prevents the admin user from logging in twice. This can cause problems with accessing the router's configuration pages while using this library.UsageList all connected devices:importasyncioimportaiohttpfromarris_tg2492lgimportConnectBoxasyncdefmain():asyncwithaiohttp.ClientSession()assession:connect_box=ConnectBox(session,"http://192.168.178.1","password")devices=awaitconnect_box.async_get_connected_devices()print(devices)awaitconnect_box.async_logout()if__name__=="__main__":loop=asyncio.get_event_loop()loop.run_until_complete(main())Please note that the list of connected devices include devices that are offline (e.g. just went out of range of the wifi). TheDeviceclass contains a propertyonlinethat can be checked.An example for retrieving a list of the MAC addresses of all online device is included in theexamplesfolder:python3list_online_devices.py--hosthttp://192.168.178.1--password<password>DevelopmentSetuparris_tg2492lgfor local development by running:python3-mvenvvenvsourcevenv/bin/activatescripts/setupThis will create a virtual environment, download the required libraries and configure a git commit hook.
Package: arris-tg3442-reboot
arris-tg3442-rebootPython tool to restart your Arris TG3442* cable modem/router remotely.Supported firmware versionsCurrently, the following firmware versions are supported:AR01.01.117.01_091718_70.PC20.10AR01.02.037.03.12.EURO.SIPRequirementsbeautifulsoup4pycryptodomerequestslxmlInstallpip install -r requirements.txtRunpython3 arris-tg3442-reboot.pyThis will usedefaultusername, password and router IP.
Use--helpto learn how to use non-default values.DockerYou can also use the providedDockerfileto build and run this tool. A pre-built image is also available ondockerhubfor these processor architectures:amd64arm64arm/v7arm/v6ThanksMost of the heavy-lifiting was already done over in theMUNIN monitoring tool repo, especially regarding login.
Package: arrivy-google-cloud-bigquery
Querying massive datasets can be time consuming and expensive without the
right hardware and infrastructure. GoogleBigQuerysolves this problem by
enabling super-fast, SQL queries against append-mostly tables, using the
processing power of Google’s infrastructure.Client Library DocumentationProduct DocumentationQuick StartIn order to use this library, you first need to go through the following steps:Select or create a Cloud Platform project.Enable billing for your project.Enable the Google Cloud BigQuery API.Setup Authentication.InstallationInstall this library in avirtualenvusing pip.virtualenvis a tool to
create isolated Python environments. The basic problem it addresses is one of
dependencies and versions, and indirectly permissions.Withvirtualenv, it’s possible to install this library without needing system
install permissions, and without clashing with the installed system
dependencies.Supported Python VersionsPython >= 3.7Unsupported Python VersionsPython == 2.7, Python == 3.5, Python == 3.6.The last version of this library compatible with Python 2.7 and 3.5 isgoogle-cloud-bigquery==1.28.0.Mac/Linuxpip install virtualenv
virtualenv <your-env>
source <your-env>/bin/activate
<your-env>/bin/pip install google-cloud-bigqueryWindowspip install virtualenv
virtualenv <your-env>
<your-env>\Scripts\activate
<your-env>\Scripts\pip.exe install google-cloud-bigqueryExample UsagePerform a queryfromgoogle.cloudimportbigqueryclient=bigquery.Client()# Perform a query.QUERY=('SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` ''WHERE state = "TX" ''LIMIT 100')query_job=client.query(QUERY)# API requestrows=query_job.result()# Waits for query to finishforrowinrows:print(row.name)Instrumenting With OpenTelemetryThis application usesOpenTelemetryto output tracing data from
API calls to BigQuery. To enable OpenTelemetry tracing in
the BigQuery client the following PyPI packages need to be installed:pip install google-cloud-bigquery[opentelemetry] opentelemetry-exporter-gcp-traceAfter installation, OpenTelemetry can be used in the BigQuery
client and in BigQuery jobs. First, however, an exporter must be
specified for where the trace data will be outputted to. An
example of this can be found here:fromopentelemetryimporttracefromopentelemetry.sdk.traceimportTracerProviderfromopentelemetry.sdk.trace.exportimportBatchSpanProcessorfromopentelemetry.exporter.cloud_traceimportCloudTraceSpanExportertracer_provider=TracerProvider()tracer_provider=BatchSpanProcessor(CloudTraceSpanExporter())trace.set_tracer_provider(TracerProvider())In this example all tracing data will be published to the GoogleCloud Traceconsole. For more information on OpenTelemetry, please consult theOpenTelemetry documentation.
Package: arrmovs
arrmovsWith this package, you can convert your INT to array and on the contraryinstalationAr first, let's install our package:pipinstallarrmovsor you can use:pip3installarrmovsConvert INT to the arrayLet's convert our INT to array and print it:importarrmovsasarrnum=12345myArr=arr.IntToArr(num)print(myArr)After that, let's convert our INT to an array, but sort it:importarrmovsasarrnum=12345myArr=arr.IntToArrSorted(num)Convert Array to INTIf we have an array and we want to convert it to an INT, we can use the module ArrToInt:importarrmovsasarrmyArr=arr.IntToArrRandom(1,10)num=arr.ArrToInt(myArr)
Package: arrnounced
ArrnouncedNotify Sonarr/Radarr/Lidarr of tracker IRC announcements.Built on the work ofsonarrAnnouncedwith tracker
configuration fromautodl-trackers(used byautodl-irssi)FeaturesAll trackers fromautodl-trackersare supported.Web UI to list announcements and accepted notificationsAbility to search among the announcements remains to be implemented thoughNotify based on announcement categoryConfigurable delay between IRC announcement and notificationOnly a few of the supported trackers are tested at the moment. Please report any issues you find.ScreenshotsMain pageStatus page (upcoming release)SetupRelease v0.7 updated the configuration format. See therelease
notesfor more
information.ConfigurationThe default configuration path is~/.arrnounced/settings.toml.example.cfgis the acting configuration documentation.The default XML tracker configuration path is~/.arrnounced/autodl-trackers/trackersInstallation# Optional virtual environment$python-mvenvpath/to/venv
$sourcepath/to/venv/bin/activate# Install$pipinstallarrnounced# Run$arrnouncedConfiguration files path as well as log and database location may be changed with command line arguments.DockerArrnounced on dockerhubYou must providesettings.tomlin/config. This is also where logs and the database will be stored.To access the web UI using bridged network the webui host in settings.toml must be0.0.0.0.As Arrnounced runs as a non-root user by default it is recommended to specify your own user to handle write access to/config.# Default exampledockerrun-v/path/to/settings:/config\--user1000\-p3467:3467weannounce/arrnounced:latestThe docker image comes with a snapshot of XML tracker configurations located under/trackers. If you prefer your own version you can mount over it.# Example with custom XML tracker configs and verbose loggingdockerrun-v/path/to/settings:/config\-v/path/to/autodl-trackers/trackers:/trackers\-eVERBOSE=Y\--user1000\-p3467:3467weannounce/arrnounced:latestDatabase design updateThe database design was updated inv0.3(ef931ee).
If you used Arrnounced prior to this or used its predecessor you have two options.Convert your old database usingconvert_db.pyMove the old database file for safe keeping and let Arrnounced create a new file.The default path to the database is~/.arrnounced/brain.db
Package: arronax
Arronaxis GUI
program to create and edit starter files (.desktopfiles) for
applications locations or URLs. It can be used as a standalone
application or as plugins for the file managers Nautilus, Nemo and
Caja.The plugins add a menu item “Create starter for this file” or “Create
a starter for this program” to the context menu (that’s the menu you
get when you right-click a file) in the file manager. If the file is a
application starter you get an item “Modify this starter” instead.On some desktop environments the plugins add a menu item “Create
starter” to your desktop’s context menu.Arronax supports most of thekeysspecified by theDesktop Entry Specificationincludingquicklists.RequirementsArronax needs:GTK 3.18 or laterPython 3.4 or laterPyGObjectnautilus-python for the Nautilus pluginnemo-python for the Nemo plugincaja-python for the Caja pluginLicenseYou can use Arronax under the conditions of GPL v3 or later.This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.You should have received a copy of the GNU General Public License
along with this program. If not, seehttp://www.gnu.org/licenses/
Package: arrotechtools
Arrotechtools LibraryInstallationInstall the latest version:pip install arrotechtoolsTo install a specific version:pip install arrotechtools==1.6Getting StartedAfter installation, you can immediately start using the library.Importing a class, an object, or a method is straight forward.Let simulate an import.from arrotechtools import Serializer, Validate, ErrorHandler, admin_requiredValidationSupported validation inputs include:EmailPasswordIntegerNamePhone:phone, airtel, safaricom, orange, equitelmethodinput typesampleemailStringtest@gmail.compasswordStringHeuliaI!djvb24628integerInteger23+ or -are also accepted i.e+25or-22nameStringJohn doephone, airtel, safaricom, orange, equitelString+254712345678Email validation ExampleLets begin with validating an email provided by a user.from arrotechtools import Validate, Serializer, ErrorHandler

email = "your@gmail.com"

if not Validate.email(email):
    return ErrorHandler.raise_error("invalid email format", 400)
else:
    ...Here, we are checking if the input is a valid email.Serializing data outputSeriale data.from arrotechtools import Serializer

#Fetching data from a database or a data structure i.e list
response = Users().get_users()
...
if response:
    return Serializer.serialize(response, "Success", 200)
else:
    ...Here, we get records from the database and storing the data in a variable. Then we serialize the data into json object or an array.
Theserializeobject can serialize any different types data into json object(s). That includeslists, dictionaries, or arrays.Error HandlingSerialize errored responses:from arrotechtools import ErrorHandler, Validate

name = "jane doe"
...
if not Validate().name(name):
    return ErrorHandler.raise_error("Name is invalid", 400)
else:
    ...Example 2Lets a look at how we can capture errors at the entry point of a flask application.from flask import Flask
from arrotechtools import Serializer

app = Flask(__name__)
...

#register error handlers
app.register_error_handler(400, Serializer.bad_request)
app.register_error_handler(404, Serializer.page_not_found)
app.register_error_handler(405, Serializer.method_not_allowed)
app.register_error_handler(500, Serializer.internal_server_error)This is a straight forward way of handling errors in flask.Admin Protected RouteThis is a function that takes an array of users as an argument and checks if the role is an admin.
If that isn't the case, the function returns an unauthorized status code and message.
Otherwise, the user is permitted to use the function.How to use the decorator to protect routesfrom arrotechtools import admin_required

@jwt_required
@admin_required(users)
def signup():
    ...The decorator takes a list ofusersas an argument.Support TeamEmail: arrotechdesign@gmail.com
Phone: +254 711 371 265AuthorHarun Gachanja G.
Package: arrowcm
arrowcmArrowcm is a Jupyter Content Manager that lets you use any pyarrow-supported filesystem as a Content Manager.Arrowcm has been tested with JupyterLab 4, but it might also work with previous versions.As Arrowcm relies on pyarrow, any pyarrow-supported filesystem should be available, and fsspec filesystems should work too.It is based on the new jupyter-server content manager interface and will not work with the old notebook content manager interface.It is available on PyPI:pip install arrowcmAfter installation, you need to configure the storage that you want to use.This can be done in your Jupyter config file, where you will need to pass an instance of a PyArrow filesystem as a filesystem property.frompyarrowimportfsc.ServerApp.contents_manager_class="arrowcm.ArrowContentsManager"# S3 examplec.ArrowContentsManager.filesystem=fs.S3FileSystem(access_key="myaccesskey",secret_key="mysecretkey",region=fs.resolve_s3_region("mybucket"),)c.ArrowContentsManager.root_dir="mybucket/notebooks"# HDFS examplec.ArrowContentsManager.filesystem=fs.HadoopFileSystem("myhdfshost")c.ArrowContentsManager.root_dir="/user/jupyter/notebooks"Arrowcm aims to be as compatible as possible with the default file content manager, so most of the options should work.
Package: arrowdantic
Welcome to arrowdanticArrowdantic is a small Python library backed by amature Rust implementationof Apache Arrow
that can interoperate withParquetApache ArrowandODBC(databases).For simple (but data-heavy) data engineering tasks, this package essentially replacespyarrow: it supports reading from and writing to Parquet, Arrow at the same or
higher performance and higher safety (e.g. no segfaults).Furthermore, it supports reading from and writing to ODBC compliant databases at
the same or higher performance thanturbodbc.This package is particularly suitable for environments such as AWS Lambda -
it takes 8M of disk space, compared to 82M taken by pyarrow.Featuresdeclare and access Arrow-backed arrays (integers, floats, boolean, string, binary)read from and write to Apache Arrow IPC fileread from and write to Apache Parquetread from and write to ODBC-compliant databases (e.g. postgres, mongoDB)ExamplesUse parquetimportioimportarrowdanticasadoriginal_arrays=[ad.UInt32Array([1,None])]schema=ad.Schema([ad.Field(f"c{i}",array.type,True)fori,arrayinenumerate(original_arrays)])data=io.BytesIO()withad.ParquetFileWriter(data,schema)aswriter:writer.write(ad.Chunk(original_arrays))data.seek(0)reader=ad.ParquetFileReader(data)chunk=next(reader)assertchunk.arrays()==original_arraysUse Arrow filesimportarrowdanticasadoriginal_arrays=[ad.UInt32Array([1,None])]schema=ad.Schema([ad.Field(f"c{i}",array.type,True)fori,arrayinenumerate(original_arrays)])importiodata=io.BytesIO()withad.ArrowFileWriter(data,schema)aswriter:writer.write(ad.Chunk(original_arrays))data.seek(0)reader=ad.ArrowFileReader(data)chunk=next(reader)assertchunk.arrays()==original_arraysUse ODBCimportarrowdanticasadarrays=[ad.Int32Array([1,None]),ad.StringArray(["aa",None])]withad.ODBCConnector(r"Driver={SQLite3};Database=sqlite-test.db")ascon:# create an empty table with a schemacon.execute("DROP TABLE IF EXISTS example;")con.execute("CREATE TABLE example (c1 INT, c2 TEXT);")# insert the arrayscon.write("INSERT INTO example (c1, c2) VALUES (?, ?)",ad.Chunk(arrays))# read the arrayswithcon.execute("SELECT c1, c2 FROM example",1024)aschunks:assertchunks.fields()==[ad.Field("c1",ad.DataType.int32(),True),ad.Field("c2",ad.DataType.string(),True),]chunk=next(chunks)assertchunk.arrays()==arraysUse timezonesThis package fully supports datetime and conversions between them and arrow:importarrowdanticasaddt=datetime.datetime(year=2021,month=1,day=1,hour=1,minute=1,second=1,microsecond=1,tzinfo=datetime.timezone.utc,)a=ad.TimestampArray([dt,None])assert(str(a)=='Timestamp(Microsecond, Some("+00:00"))[2021-01-01 01:01:01.000001 +00:00, None]')assertlist(a)==[dt,None]asserta.type==ad.DataType.timestamp(datetime.timezone.utc)
Package: arrow-fatisar
Documentation:crsmithdev.com/arrowWhat?Arrow is a Python library that offers a sensible, human-friendly approach to creating, manipulating, formatting and converting dates, times, and timestamps.  It implements and updates the datetime type, plugging gaps in functionality, and provides an intelligent module API that supports many common creation scenarios.  Simply put, it helps you work with dates and times with fewer imports and a lot less code.Arrow is heavily inspired bymoment.jsandrequestsWhy?Python’s standard library and some other low-level modules have near-complete date, time and time zone functionality but don’t work very well from a usability perspective:Too many modules:  datetime, time, calendar, dateutil, pytz and moreToo many types:  date, time, datetime, tzinfo, timedelta, relativedelta, etc.Time zones and timestamp conversions are verbose and unpleasantTime zone naievety is the normGaps in functionality:  ISO-8601 parsing, timespans, humanizationFeaturesFully implemented, drop-in replacement for datetimeSupports Python 2.6, 2.7 and 3.3Time zone-aware & UTC by defaultProvides super-simple creation options for many common input scenariosUpdated .replace method with support for relative offsets, including weeksFormats and parses strings, including ISO-8601-formatted strings automaticallyTimezone conversionTimestamp available as a propertyGenerates time spans, ranges, floors and ceilings in timeframes from year to microsecondHumanizes and supports a growing list of contributed localesExtensible for your own Arrow-derived typesQuick startFirst:$pipinstallarrowAnd then:>>>importarrow>>>utc=arrow.utcnow()>>>utc<Arrow [2013-05-11T21:23:58.970460+00:00]>>>>utc=utc.replace(hours=-1)>>>utc<Arrow [2013-05-11T20:23:58.970460+00:00]>>>>local=utc.to('US/Pacific')>>>local<Arrow [2013-05-11T13:23:58.970460-07:00]>>>>arrow.get('2013-05-11T21:23:58.970460+00:00')<Arrow [2013-05-11T21:23:58.970460+00:00]>>>>local.timestamp1368303838>>>local.format()'2013-05-11 13:23:58 -07:00'>>>local.format('YYYY-MM-DD HH:mm:ss ZZ')'2013-05-11 13:23:58 -07:00'>>>local.humanize()'an hour ago'>>>local.humanize(locale='ko_kr')'1시간 전'ContributingContributions are welcome, especially with localization.  Seelocales.pyfor what’s currently supported.