Saravanan666/pypi-org huggingface dataset:
Package: canarymd
Thecanarymdpython library offers an interface to the Canary Health
API atcanary.md.TL;DRInstall:$pipinstallcanarymdUse:importcanarymdclient=canarymd.Client(principal='{USERNAME}',credential='{PASSWORD}')html=client.select(context='{CONTEXT}',peo={'transport':canarymd.Transport.SITE,'purpose':canarymd.Purpose.PREPARE,'recipient':recipient.toHL7(),'appointment':{'time':'2014-12-02T18:20:06Z','patients':[patient.toHL7()forpatientinpatients],'provider':provider.toHL7(),'type':'new','reason':'us/namcs:5035.0','policy':policy.toHL7(),},},timeout=30,).content# now do something with the HTML messages!TODO: add documentation
Package: canary-pkg-whoward3
CanaryA Python Package developed as part of CEDARs Project Canary to enable the rapid simulation of Distributed DDoS Detection techniques using CORE.See the LICENSE file included in this distribution.Get StartedClone this repositoryInstall CORE v.5.4.0Update thecore.confto point thecustom_services_dir =to the../canaryServicesdirectory in this repositoryOpen a bash terminal in the repositories root directoryRunpython3 setup.py install --userto install the packageRun the tests viapython3 -m tests.test_canaryIf all tests passOKyour good to go!UsageAll the scripts in canaryScripts can be run independently or in conjunction depending on the use case. Scripts can be run from the terminal or loaded into the CORE GUI using theExecute Python script with optionsbutton. Use thecanary_driver.pyscript to orchestrate the execution of multiple simulations. For more see thewiki.
Package: canarypy-airflow-plugin
CanaryPy Airflow PluginThis is a plugin for Apache Airflow that provides integration with CanaryPy. It modifies the task policies in Airflow, to send signals to CanaryPy on task success or failure. It also adds a custom Jinja template function that can be used to get the latest stable version of an artifact.RequirementsPython 3.8+Apache Airflow 2.0+CanaryPyLibraryInstallationThis plugin is available in Pypi so you can add to your Airflow installation by running the following command:pip install canarypy_airflow_pluginAlternatively, you can add the plugin to Airflow dependencies file.Also disable lazy loading of plugins by settinglazy_load_pluginstoFalsein your Airflow configuration file:[core]lazy_load_plugins=FalseConfigurationThe plugin uses the environment variableCANARYPY_URLto set the base URL for CanaryPy. This environment variable must be set before the plugin is loaded by Airflow.How It WorksThe plugin patches thetask_policyfunction in Airflow's settings. If an existingtask_policyfunction exists, it is wrapped, so that the original policy is applied first, followed by the policy provided by this plugin.The plugin's policy adds customon_failure_callbackandon_success_callbackfunctions to the tasks. These functions send a signal to CanaryPy, containing information about the task's image, run ID, task ID, and state.If a task is aMappedOperator, the policy applies the custom callbacks via thepartial_kwargsattribute, to work around the fact that these operators do not haveon_failure_callbackandon_success_callbackproperties.Finally, the plugin adds aget_latest_stable_versionfunction to the Jinja environment, which can be used in your DAGs. This function retrieves the latest stable version of an artifact from CanaryPy, given the artifact's URL.UsageWith this plugin installed, your tasks in Airflow will automatically send signals to CanaryPy when they start, succeed or fail. This happens without needing any changes to your DAGs.To use theget_latest_stable_versionfunction in a Jinja template, use the following syntax:{{ get_latest_stable_version('artifact_url') }}ContributingWe welcome contributions! Please feel free to submit a Pull Request.
Package: canarytools
Thinkst Applied ResearchOverviewThe Python Canary API Wrapper allows access to the Canary Web API.InstallationThe API is supported on python 2.7. The recommended way to
install the API Wrapper is viapip.pipinstallcanarytoolsFor instructions on installing python and pip see “The Hitchhiker’s Guide to
Python”Installation Guides.QuickstartAssuming you have your API key handy as well as the domain of your website:importcanarytoolsconsole=canarytools.Console(api_key='API_KEY',domain='CLIENT_DOMAIN')Note:You can find your API key and domain on your console. Head over to the console’s setup page and underCanary Console APIyou’ll find your API key. Your domain is the tag in-front of ‘canary.tools’ in the console’s
url. For example inhttps://testconsole.canary.tools/settingstestconsoleis the domain.Alternatively,
you can download a configurations file from theCanary Console APItab. Inside the file you’ll find instructions
on where to place it. If you have this on your system theapi_keyanddomainparameters are no longer
necessary when instantiating aConsoleobject.With theconsoleinstance you can then interact with a Canary Console:# Get all devicesconsole.devices.all()# Acknowledge all incidents for a device older than 3 daysconsole.incidents.acknowledge(node_id='329921d242c30b5e',older_than='3d')# Iterate all devices and start the update processfordeviceinconsole.devices.all():device.update(update_tag='4ae023bdf75f14c8f08548bf5130e861')# Acknowledge and delete all host port scan Incidentsforincidentinconsole.incidents.unacknowledged():ifisinstance(incident,canarytools.IncidentHostPortScan):incident.acknowledge()incident.delete()# Create a web image Canarytokenconsole.tokens.create(kind=canarytools.CanaryTokenKinds.KIND_WEB_IMAGE,memo='Drop this token on DC box',web_image='/path/to/test.png',mimetype='image/png')# Print out the name of all incidents and the source IP addressforincidentinconsole.incidents.all():printincident.description,incident.src_hostPlease see the API doc’sdocumentationfor
more examples of what you can do with the Canary Console API.Discussion and SupportPlease file bugs and feature requests as issues onGitHubafter first searching to ensure a
similar issue was not already filed. If such an issue already exists please
give it a thumbs up reaction. Comments to issues containing additional
information are certainly welcome.DocumentationThe documentation is located athttp://canarytools.readthedocs.io.LicenseThe Python Canary API Wrapper’s source (v1.0.0+) is provided under theRevised BSD License.Copyright (c), 2017, Thinkst Applied Research
Package: canarytrap
CanaryTrapCanaryTrap is a Python package that uses the concept of a "canary trap" to watermark text using unicode spaces. By converting regular spaces to unicode spaces according to a binary pattern, you can add a hidden signature to your text.InstallationYou can install CanaryTrap using pip:pip install canarytrapHow to useFirst, import the package:importcanarytrapascanaryTo watermark your text, use theunicode_space_encodefunction. You can either provide a binary string or let the function generate a random one:text="Hello world this is a test"watermarked_text,binary_str=canary.unicode_space_encode(text)print(watermarked_text)# Watermarked textprint(binary_str)# Binary string used for watermarkingYou can convert the watermarked text back to binary using theunicode_space_to_binary_strfunction:binary_str_back=canary.unicode_space_to_binary_str(watermarked_text)print(binary_str_back)# Should be the same as binary_strTo check if a text matches a given binary string, use theunicode_space_matchfunction:match=canary.unicode_space_match(watermarked_text,binary_str)print(match)# Should be 1.0 if text is not modifiedExample ScenarioYou have someone who is leaking private documents and want to find out who. You're about to send an email to a bunch of different employees. Let's use CanaryTrap to find out who it is.First, let's encode our emailimportcanarytrapascanarystaff_email="Hello staff, this is a test email. Please do not share this email with anyone else."watermarked_email,binary_str=canary.unicode_space_encode(staff_email)withopen("email.txt","w",encoding="utf-8")asf:f.write(watermarked_email)withopen("binary.txt","w",encoding="utf-8")asf:f.write(binary_str)The unicode characters will not appear (Is an empty character). Try copying that text into a code editor to see itHello‎ staff,‎ this is a test email.‎ Please do‎ not share‎ this‎ email‎ with anyone‎ else.You can then check some text against the watermark:importcanarytrapascanarywatermarked_text="Hello‎ staff,‎ this is a test email.‎ Please do‎ not share‎ this‎ email‎ with anyone‎ else."match=canary.text.unicode_space_match(watermarked_text,binary_str)print(match)# Should be 1.0 if text is not modifiedNoteIf the watermarked text is edited (spaces are added, removed, or replaced), the match percentage returned by theunicode_space_matchfunction may be less than 1.0. If you get a match percentage of less than 1.0, it means that the text was likely edited after being watermarked. The match percentage gives an estimate of how much of the original watermark remains in the text.
Package: canaveral
Canaveral: Quickly find and open applications and filesBlazing fast search: Indexes folders you specify, cataloging files and subdirectories matching your specified filtersGlobally available via a user-configurable hotkeyLearns your preferences, bringing previously-opened files and applications to the top of search resultsInstallationYou can install Canaveral in (at least) two different ways, depending on your needs:Install in an isolated virtual environment from PyPI viapipx. This path is generally recommended for normal usage.Create your own virtual environment, clone the Canaveral git repo, and install Canaveral in 'dev mode' withpip install -e(also known as 'editable' mode). This path is recommended for development.Installation viapipxInstall pipx first, if you don't already have pipx installed. Simply run the following commands at the terminal:python-mpipinstall--userpipx
python-mpipxensurepathAfter installingpipx, you'll need to log out and log back in so that it will be added to your path.Usepipxto install Canaveral from PyPI.pipxwill automatically create an isolated virtual environment and install Canaveral into it from PyPI:pipxinstallcanaveralInstallation viapipfrom a local copy of the repo, in 'editable' modeCreate a virtual environment and activate it. If you're choosing this path, we'll assume you already know how to do this.Install Canaveral into the virtual environment in 'editable' mode by running the following command from the canaveral source directory (where setup.py is located):pipinstall-e.Running CanaveralIf you've installed Canaveral into your own virtual environment, you'll need to activate it first. You can skip this step if you installed Canaveral viapipx.Run from the command line:canaveral.Canaveral looks in %APPDATA%\Canaveral for a file called paths.py that defines the locations and extensions it should index. The first time you run Canaveral, this directory is created and a paths.py with the default search locations will be placed there. Modify this file to suit your needs and save it in place, as paths.py.Bring up the Canaveral window with the Ctrl+Alt+Space hotkey.Start typing your search.Select your desired entry from the drop-down list (via keyboard or mouse) and press enter. If no entry is selected, the first item in the list will be launched (so there's no need to select it).As you search for items and launch them, Canaveral will remember your choices and place the launched items at the top of the results for relevant searches.Alternate ways to launch CanaveralIf you are interested in developing Canaveral and have installed it via thepip install -e .method above, you can directly launch Canaveral from its source directory by activating the virtual environment and then running themain.pyfile directly:pythonmain.pyYou can also launch Canaveral from a Windows shortcut if you put the full path to the virtual environment's python location and to main.py as the Target, and the Canaveral directory as the working directory (the 'Start In' location). If you put this shortcut in your Startup directory, it will launch Canaveral on Windows startup.Releases0.1.0: 2021-09-28First public release
Package: canaveral-cli
Canaveral CLIThis Project usesTyperfor the CLI functionality andInquirerPyfor the parameter selectionRun itWorking with virtual envs in Python:https://realpython.com/python-virtual-environments-a-primerhttps://aaronlelevier.github.io/virtualenv-cheatsheet/$python3-mvenvvenv--prompt="canaveral-env"$sourcevenv/bin/activate(canaveral-env)$(canaveral-env)$deactivate
$$pipinstall-rrequirements.txt
$OR
$python-mpipinstall-rrequirements.txtHow to contribuiteProject layout to adhere to:https://realpython.com/python-application-layouts/#command-line-application-layoutsInternal NotesDevscope Internal notes and documentation avaible atCanaveral
Package: canbro
python-canbrothe name of the package canbro arose from can and broqer which are the two main python packages which are used in this combination. Additionaly the cantools is also a main contributer for now. But maybe will be replaced with a own implementation in future.This package use the python-can and extend the python-cantools with the python-broqer package. There the functionality to work in a reactive style with can signals and messages will be provided.Dependenciescanbrorequires the following dependencies:can(version 3.3 or later)cantools(version 36.2 or later)broqer(version 1.7 or later)Usageexample cylce messagesfromcan.interfaceimportBusfromcantools.databaseimportload_filefrombroqerimportSinkfromcanbroimportNode# load dbc filedb=load_file('device_CAN.dbc')# create ECU node with virtual bus testbus_e=Bus('test',interface='virtual')ecu=Node(name="ECU",bus=bus_e,database=db)# create VCU node with virtual bus test, and connect to ECU via same name of bus -> testbus_v=Bus('test',interface='virtual')vcu=Node(name='CONTROL',bus=bus_v,database=db)defshow_vcu_value(value):print('value={}'.format(value),end='')show_print=ecu.DEM._signal_operation_mode.subscribe(Sink(show_vcu_value))vcu.DEM.start_periodic()vcu.DEM._signal_operation_mode.notify(2)Licensecanbro is licensed under the MIT License. See the LICENSE file for more information.Authorcanbro was created by Lukas Riegler.
Contact him via a issue on github.Versioncanbro version 0.0.1 in progress.
Package: cancelable
Installationpip install cancelableUsageWithout the normal time package:Sleepfromcancelableimporttimeimportthreadingdefcount():i=1whileTrue:time.sleep(1)print(i)i+=1threading._start_new_thread(count,())input("Click enter to cancel counting\n")time.cancel()With the normal time package:fromcancelableimporttimeascancelableTimeimportthreadingdefcount():i=1whileTrue:cancelableTime.sleep(1)print(i)i+=1threading._start_new_thread(count,())input("Click enter to cancel counting\n")cancelableTime.cancel()Inputfromcancelableimporttime,input,cancelInputimportthreadingname=""defask():globalnamename=input("Your name: ")time.cancel()threading._start_new_thread(ask,())time.sleep(5)cancelInput()print(name)To doAdd more functions such as input()
Package: cancelable-py
Installationpip install cancelable-pyUsageWithout the normal time package:fromcancelableimporttimeimportthreadingdefcount():i=1whileTrue:time.sleep(1)print(i)i+=1threading._start_new_thread(count,())input("Click enter to cancel counting\n")time.cancel()With the normal time package:fromcancelableimporttimeascancelableTimeimportthreadingdefcount():i=1whileTrue:cancelableTime.sleep(1)print(i)i+=1threading._start_new_thread(count,())input("Click enter to cancel counting\n")cancelableTime.cancel()To doAdd more functions such as input()
Package: cancel-token
CancellationToken for PythonThis library provide simple cancellation token.UsageFirst create tokenfromcancel_tokenimportCancellationTokentoken=CancellationToken()At any point in time you can check if token has been cancelled:iftoken.cancelled:print('Operation already cancelled')returnNoneTo cancel token call itscancelmethod:token.cancel()asserttoken.cancelledIt is also possible to add callbacks that will be called on when token is cancelled:defhandler():print('Operation has been cancelled')token.on_cancel(handler)Note:If token is already cancelled, callback will be invoked immediately.All registered callbacks will be called sequentially duringcancelcall.Callback throwing exception will prevent remaining callbacks from calling. However token will be cancelledDuring callback invocation token is already cancelledIt is possible to add callback from within callbackRemoving callback from within callbackwill notprevent its execution
Package: cancli
cancliA command line interface to send and receive CAN bus messages.This program is based on:prompt_toolkitfor the user interfaceconfattrfor parsing user input, providing auto completion and config filescantoolsfor decoding and encoding CAN bus messagespython-canfor receiving and transmitting CAN bus messagesUsageConnect to a CAN bus withbus can0 500k.
Incoming messages are printed.
If there are too many messages you can hide some or all of them withhide.
You can undohidewithshowor display a hidden message once withnextorprev.When you load a database file withdb path/to/db.dbcmessages are decoded
and the signals are displayed in human readable form.
If the data base file does not repeat the messages for every possible node
you can specify that part of the arbitration id is a node id withnode-id FF << 8.You can send messages withsend msg_name sig1=option1 sig2=3.14.You can give different incoming messages different colors withset color.message=%color.message%,importantmessage:ansired.
The syntax to add values to a dict setting is explainedhere.
The available colors are displayed in the auto completion.Available commands:bitrate:    Set the default bitrate and change the bitrate of all active buses.bus:        Activate a bus.read:       Read CAN bus messages from a log file.db:         Load a database file (dbc/sym/...).node-id:    Specify that part of an arbitration id is a node id.mask:       Specify a mask to modify an arbitration ID in case it is not found in the dbc file.send/s:   Send a message on the last activated CAN bus.hide/-:   Do not print received messages of the specified type.show/+:   Undo the effect of a previous hide command.next//:   Print the next received message of the specified type regardless of
whether it has been disabled with the hide command.prev/?:   Print the last received message of the specified type.grep:       Search for signal.set:        Change the value of a setting.include:    Load another config file.save:       Save the settings.echo:       Display a message.help:       Display help.quit/q:   Quit the program.Installationpipx install cancliLinksDocumentationSource codeBug trackerChange logRunning the testsI am usingmypyfor static type checking.toxcreates a virtual environment and installs all dependencies for you.
You can install tox withpipx(pipx install tox).$toxIn order to make tox work without an internet connection installdevpi:$pipxinstalldevpi-server
$devpi-init
$devpi-gen-config
$su# cp gen-config/devpi.service /etc/systemd/system/# systemctl start devpi.service# systemctl enable devpi.serviceand add the following line to your bashrc:exportPIP_INDEX_URL=http://localhost:3141/root/pypi/+simple/LicenseThis work is free. You can use, copy, modify, and/or distribute it
under the terms of theBSD Zero Clause License.
Package: candfans-client
candfans-client非公式のCandfansのAPI Clientです。なんの保証もありません。installhttps://pypi.org/project/candfans-client/pippipinstallcandfans-clientpoetrypoetryaddcandfans-clientexampleinit and login初期化時にログインを行います。fromcandfans_client.clientimportCandFansClientclient=CandFansClient(email='YOUR_EMAIL',password='YOUR_PASSWORD',)get_sales指定月の売上のサマリーを取得します。sales=client.get_sales('2023-11')print(sales[0].subscribe_sum)get_sales_history指定月の売上の履歴を取得します。histories=client.get_sales_history('2023-11')print(len(histories))print(histories[0])get_sales_purchase_post指定月の単体販売の詳細を取得します。purchase=client.get_sales_purchase_post('2023-11')print(purchase.total_price,len(purchase.sales))get_sales_subscribe指定月のサブスクの詳細を取得します。subscribe=client.get_sales_subscribe('2023-11')print(subscribe.total_price,len(subscribe.sales))get_sales_chip指定月のチップの詳細を取得します。chip=client.get_sales_chip('2023-11')print(chip.total_price,len(chip.sales))get_sales_backnumber指定月のバックナンバーの売上の詳細を取得します。backnumber=client.get_sales_backnumber('2023-11')print(backnumber.total_price,len(backnumber.sales))contributiontestpoetry run python -m unittest discover -s tests/
Package: candideitorg-django
this is an API client for candideit.org usable in any django project.#Tests##Requirements
-sqlite3
-mercurial
-virtualenvwrapper##Execution
create local virtual environment`shell mkvirtualenv candideitorg_django `install requirements`shell pip install-rrequirements.txt `run script start_local_candideitorg.bash`shell ./start_local_candideitorg.bash `run tests`shell python manage.py test candideitorg `Afterwards you might want to kill the candideitorg process. For that you’ll have to find its pid`shell ps aux | grep candideitorg `And then kill it`shell kill <pid of candidaitorg process> `
Package: candiy
ReadmeGUI to monitor a CAN network and communicate with an ECU.InstallationInstall this via pip (or your favourite package manager):pip install candiyStart developingThe project usesPoetryfor dependencies management and packaging. Make sure you have it installed in your development machine. To install the development dependencies in a virtual environment, type:poetryinstallThis will also generate apoetry.lockfile, you should track this file in version control. To execute the test suite, call pytest inside Poetry's virtual environment viapoetry run:poetryrunpytestCheck out thePoetrydocumentation for more information on the available commands.For those usingVS Codethere are tasks defined for the most common commands:install development dependenciesrun testsrun all checks configured for pre-commitgenerate documentationSee the.vscode/tasks.jsonfor more details.Committing changesThis repository usescommitlintfor checking if the commit message meets theconventional commit format.Contributors ✨Thanks goes to these wonderful people (emoji key):This project follows theall-contributorsspecification. Contributions of any kind welcome!CreditsThis package was created withCopierand thebrowniebroke/pypackage-templateproject template.The icons were created fromTabler Icons.
Package: candl
candlA tiny, pedagogical implementation of a neural network library with a pytorch-like API. The primary use of this library is for education. Use theactual pytorchfor more serious deep learning business.The implementation is complete with tensor-valued autodiff (~100 lines) and a neural network API built off of it (~80 lines).LearningThis little project is actually the result ofan article I wrote. Using it, you can learn more about how neural networks work and implement everything in candl yourself from scratch.InstallationpipinstallcandlUsageFirst, import candl.importcandlCandl comes with two modules:nnandTensor. Thennmodule contains tools like modules, layers, SGD, MSE, etc. Candl tensors are extensions of numpy ndarrays that can be used to represent data and compute derivatives.To train a neural net (let's try to learn XOR), first we can create a model.nn=candl.nnmodel=nn.Sequential(nn.Linear(2,64),nn.ReLU(),nn.Linear(64,32),nn.ReLU(),nn.Linear(32,1))lr=1e-3loss_fn=nn.MSE()optimizer=nn.SGD(model.parameters(),lr)Then, we train:data=[([0,0],[0]),([0,1],[1]),([1,0],[1]),([1,1],[0])]forepochinrange(100):forsampleindata:"""Note that we only allow batches of data, so the shape of the tensor must be n x m,where m is the dimensionality of the input for each batch."""x=candl.tensor([sample[0]])y=candl.tensor([sample[1]])loss=loss_fn(model.forward(x),y)loss.backward()# The `True` argument automatically zeroes the gradients after a stepoptimizer.step(True)FeaturesTensors built upon numpy's ndarraysTensor-valued autogradMean Squared Error Loss FunctionStochastic Gradient Descent (SGD)Blocks (Modules) for putting together neural networksBuilt-in layers: Linear, ReLU, Sigmoid, Tanh