Saravanan666/pypi-org huggingface dataset:
Package: transferwise-python-sdk
TransferWise Python SDKAn unofficial Python SDK to facilitate the use of the TransferWise API.Installation$pipinstalltransferwise-python-sdkUsageimportosimportuuidfromdecimalimportDecimalfromtransferwise.clientimportClientfromtransferwise.modelsimport(Account,Profile,Quote,Transfer,TransferRequirements,Fund)api_token=os.environ.get('TRANSFERWISE_API_TOKEN')private_key=os.environ.get('TRANSFERWISE_PRIVATE_KEY')client=Client(api_token,private_key,sandbox=True)# get profileprofile=Profile.get(client)# create quotequote=Quote.create_from_dict({'profile':profile,'source':'EUR','target':'EUR','target_amount':Decimal('1000')})# quote is updated with server responsequote.post(client)# validate account requirementsaccount_requirements=quote.get_account_requirements(client)# create accountaccount=Account.create_from_dict({'currency':'EUR','type':'sort_code','profile':profile,'account_holder_name':'The Dude Inc.','legal_type':'BUSINESS','details':{'legalType':'BUSINESS','iban':'DE51700111106050000891'}})# verify recipient accountaccount.verify(account_requirements)# proceed if there are no errors# account is updated with server responseaccount.post(client)# create transfertransaction_id=uuid.uuid4()# required for request idempotencytransfer_reference='Order XXX reference'source_of_funds='verification.source.of.funds.other'transfer=Transfer.create_from_dict({'target_account':account,'quote':quote,'customer_transaction_id':transaction_id,'details':{'reference':transfer_reference,'transfer_purpose':'verification.transfers.purpose.pay.bills','source_of_funds':source_of_funds}})# transfer requirementstransfer_requirements=TransferRequirements.create_from_dict({'target_account':account,'quote':quote,'details':{'reference':transfer_reference,'source_of_funds':source_of_funds,'source_of_funds_other':'Trust funds'},'customer_transaction_id':transaction_id})transfer_requirements.post(client)transfer.verify(transfer_requirements)transfer.post(client)# fund transferfund=Fund.create_from_dict({'type':'BALANCE'})fund.post(client,profile_id=profile._sync.id,transfer_id=transfer._sync.id)Model ArchitectureWhenever the model is sent to the API as payload, the response populates the_syncattribute, which is a dictionary.Thanks to__getattribute__magic method, properties coming from the API are available as instance attributes, e.g.:obj.id(whereidis actually inobj._sync['id']). This way reading attributes you get the synced version from the server if exists, otherwise the local attribute is returned. In case you want to access the local attribute easily, there's also anattrmethod.Models have also a class methodgetwith an optionalidparameter. Whenidisn't specified, a list of object will be returned.In order to interact with the client, models are able to generate their own API paths through the protected method_get_path.Client ArchitectureThe client is very simple. To instance it, it needs your API token.Thegetandpostmethods accept a path and extra parameters to build and submit a request to the APIRequests are made via therequestspackage using aSessioninstance with a customHTTPAdapter, making possible to add retries if needed.
Package: transfluent
This is a Python wrapper for theTransfluent API.Installation$ pip install transfluentUsageimporttransfluent# Initialize the Transfluent client and retrieve your authentication# token by using your email and password.client=transfluent.Transfluent()client.authenticate(email='example@example.org',password='my-password')# Alternatively, you may initialize the Transfluent client directly# with your authentication token.client=transfluent.Transfluent(token='my-token')# Order translations for a resource file.response=client.file_save(identifier='my-project/messages',language=1,file=open('translations/messages.pot'),type='po-file')print"The file contains{0}words.".format(response['word_count'])response=client.file_translate(identifier='my-project/messages',language=1,target_languages=[11],)print"{0}words were ordered.".format(response['word_count'])# Check if the translation for the resource file is complete.is_translated=client.is_file_complete(identifier='my-project/messages',language=11)ifis_translated:# Retrieve the translated resource file.content=client.file_read(identifier='my-project/messages',language=11)withopen('translations/en/LC_MESSAGES/messages.po','w')asout:out.write(content)else:# Check the precise translation progress for the resource file.status=client.file_status(identifier='my-project/messages',language=11)print"Translation is{0}complete.".format(status['progress'])ResourcesIssue TrackerCodeDevelopment VersionChangelogHere you can see the full list of changes between each Transfluent for Python
release.0.3.0 (February 10, 2016)Added Python 3 support.0.2.1 (May 29, 2013)Fixed a bug in howtexts_translatehandledtarget_languagesparameter.0.2.0 (May 29, 2013)Implemented Python wrappers forTextsandTextsTranslatemethods in
Transfluent’s API0.1.0 (April 22, 2013)Initial public release.
Package: transfocate
transfocateophyd Devices for transfocator access in hutch-pythonAutomated calculation of beryllium lens focusing optics for MFX TransfocatorAutomated checkout tools for verifying PLC interlock statusReport generation for the latterNote about RPThis module is not under Radiation Protection’s defined scope for items which require
a permit to complete.Note about the IOCioc-mfx-tfs-lens holds some important state for this ophyd support and calculations to work properly.
If you experience zero division exceptions when performing calculations, chances are that the IOC
has some invalid values stored.Automated Checkout toolsThese scripts use the IOC-defined bypass tools, meaning that no lenses will be
moved and photon energy does _not_ need to change.** Do not run these scripts without permission from MFX. **Performing a checkoutFirst, load an IPython session with this module:$source/reg/g/pcds/pyps/conda/pcds_conda$ipython-i-mtransfocate.automated_checkoutIf the above times out, re-run the script.  It’s ophyd related and will be
resolved eventually.  Otherwise, continue on.Manual modeTo perform a scan for a single XRT lens, use:>>>sweep_and_plot_xrt(xrt_lens,num_steps=100)This will choose different combinations of TFS lenses to span the region, and
scan energy in 100 discrete steps.
To perform a scan for _all_ XRT lenses, use:>>>sweep_and_plot_xrt_all(num_steps=100)Per-lens data and plots will be saved to Excel and PNG/PDF files, respectively.
This can be combined into a full checkout report with the following:>>>generate_report()Automatic modeAutomatic mode will performsweep_and_plot_xrt_all()andgenerate_report()for you.Report generationReport generation will use the files generated from the scan steps above.
It will only use existing files from the current directory.
It can be used on its own - after exiting the IPython session and reloading
it - without scanning again.Now, you’ll have the option to perform the steps automatically or manually.AuthorsTeddy Rendahl, Taryn Imamura, Ken Lauer, and anyone else listed ingit blame.
Package: transforge
transforgeA transformation language is used to describeprocesses, like the ones
implicit in workflows or software tools, astransformations between
types. These types do not necessarily denote a concrete data structure,
and the descriptions may be independent from any particular
implementation. The goal is only to capture some properties that are
deemedconceptuallyrelevant, as a form ofprocedural metadata.transforgefacilitates defining a transformation language and parsing
its expressions into semantic graphs. It is written in pure Python with
few dependencies.In order to reason about about transformations, it also implements atype inferencemodule,
which accommodates bothsubtype-andparametricpolymorphism.Expressions of a transformation language can be turned into
transformation graphs. Such graphs can be serialized intoRDF, or
converted toSPARQLqueries and
matched against other graphs. This enables flexible searching through
processes.The library is still in development. Interfaces might change without
warning.UsageThis package was developed for theCCTalgebra for geographical information, which may act as an example.Click here for atutorial.
Package: transform
Transform MQLAuth setup:# Follow the prompts to either enter api_key or perform MFAmqlsetupNOTE:All configs including pinned models, api_key, bearer tokens will be stored under the default directory at~/.transform/config.yml. If another location is desired, please set an ENV variable at$TFD_CONFIG_DIRwith the desired path.CLI Usage:Runmql --helpfor a list of all available commandsUsage: mql [OPTIONS] COMMAND [ARGS]...

Options:
  -v, --verbose
  --debug-log-file
  --help            Show this message and exit.

Commands:
  commit-configs         Commit yaml configs found in specified config...
  contact                Instructions for how to contact Transform for help.
  drop-cache             Drop the MQL cache.
  drop-materialization   ***NEW*** Create a new MQL drop materialization...
  get-dimension-values   List all dimension values that are queryable...
  health-report          Completes a health check on MQL servers.
  identify               Identify the currently authenticated user.
  latest-mql-image       Outputs the latest MQL server image details
  list-dimensions        List all unique dimensions for the Organization.
  list-materializations  List the materializations for the Organization...
  list-metrics           List the metrics for the Organization with their...
  list-queries           Retrieve queries from mql server
  list-servers           Lists available MQL servers.
  materialize            ***NEW*** Create a new MQL materialization...
  pin-model              Pin a model id from configs that are already...
  ping                   Perform basic HTTP health check against...
  query                  Create a new MQL query, polls for completion and...
  setup                  Guides user through CLI setup.
  stream-query-logs      Retrieve queries from mql server
  unpin-model            Unpin a model id
  validate-configs       Validate yaml configs found in specified config...
  version                Print the current version of the MQL CLI.Examples:mql query --metrics messages --dimensions ds --limit 10
mql materialize --materialization-name name --start-time 2021-10-01 --end_time 2021-11-01Python LibraryExamples:# Instantiating the object manuallyfromtransform.mqlimportMQLClient"""Pass:- api_key if you want to manually provide an api_key- mql_server_url if you want to override the mql serverDEFAULT: values in ~/.transform/config.yml"""mql=MQLClient(api_key:Optional[str],mql_server_url:Optional[str])df=mql.query(metrics=["messages"],dimensions=["ds"],where="is_thread")# If authentication already exists in configfromtransformimportmqldf=mql.query(metrics=["messages"],dimensions=["ds"],where="is_thread")API ReferencesSee more details athttps://docs.transform.co/
Package: transform3d
transform3dHandy classes for working with trees of 3d transformations.Usesscipy.spatial.transform.Rotationfor stable conversions between rotation representations.install$ pip3 install transform3dconventiona_t_bdenotesbrelative toa, such that a point
in frameb,p_b, is transformed to frameaby:p_a = a_t_b @ p_b(Note that@is the matmul operator in python.)
This provides easy to read series of transformations:a_t_d = a_t_b @ b_t_c @ c_t_d.usageimportnumpyasnpfromtransform3dimportTransform,SceneNode,SceneState# basic Transform usagea_t_b=Transform(p=(1,0,0),rotvec=(0,0,0))b_t_c=Transform(p=(0,0,1),rpy=(0,0,np.pi/2))a_t_c=a_t_b@b_t_cc_t_a=a_t_c.inv# transform a point from a's frame to c's framep_a=(1,0,0)p_c=c_t_a@p_a# or multiple pointsp_a=np.random.randn(2,3)# two points (x, y, z)p_c=c_t_a@p_a# rotate vectorsv_a=(1,0,0)v_c=c_t_a.rotate(v_a)# or screws (6d, eg. force-torque)s_a=(1,0,0,1,0,0)s_c=c_t_a.rotate(v_a)# using SceneNode to build a treeroot=SceneNode()a=SceneNode(parent=root)b=SceneNode(parent=root)c=SceneNode(parent=b)# or:root,a,b,c=SceneNode.n(4)root.adopt(a,b.adopt(c))# set node transforms in relation to parentsstate=SceneState()state[a]=Transform(p=(1,0,0),rpy=(np.pi,0,0))state[b]=Transform(rotvec=(0,90,0),degrees=True)state[c]=Transform(quat=(0,0,0,1))# calculate transforms between nodesc_t_a=c.p(a,state)# type: Transform# solve for transformsc_t_a_desired=Transform(p=(1,2,3),R=np.eye(3))state[b]=b.solve(c,a,c_t_a_desired,state)assertc.p(a,state).equals(c_t_a_desired)
Package: transform-airflow
Transform AirflowInstall:pipinstalltransform-airflowAvailable Operators:MaterializeOperatormaterialization_name: strstart_time: Optional[str]end_time: Optional[str]model_key_id: Optional[int]=Noneoutput_table: Optional[str]=Noneforce: bool=FalseCreating DAG:fromtransform_airflow.operatorsimportMaterializeOperator# Init DAGmy_dag=DAG("my_dag_name")# Associate task with DAGop=MaterializeOperator(task_id=task_id,materialization_name="test",start_time="2021-01-01",end_time="2021-01-10",)# Perform any dependency structuring on tasks
Package: transformapy
transformapy: A Toolkit for Identifying Transformation Product Structures of Emerging Contaminants Using HRMS Datatransformapy is a Python toolkit engineered to process molecular structures, pinpointing potential transformation products of specified compounds by leveraging observed monoisotopic masses.Contributor: Rui WangFirst release date: Feb.28.2024UpdateFeb.29.2024: transformapy 0.0.2Second versionfix some bugsDependenciestransformapy requires the following major dependencies:rdkitpyhrmsFeaturestransformapy provides the following functions:Identifying Transformation Product Structures of Emerging Contaminants Using HRMS DataPaper Published Utilizing transformapyPreparingLicensingThe package is open source and can be utilized under the MIT license. Please find the detail in the license file.transformapy DocumentationGetting Started with transformapyfromtransformapy.transformapyimport*Project Structure:transformapy/
|- generate_possible_TP_structures
   |- modify_chemical_formula
   |- generate_fragments
   |- calculate_formula_differences
   |- calculate_changed_num
      |- parse_formula
   |- recursive_reaction
      |- reaction_type
         |- combine_fragments_and_generate_smiles
         |- replace_dummies_with_hydrogens
         |- replace_hydrogen_with_substituent
         |- split_molecule_at_bond
         |- Remove_2H
            |- is_atom_in_double_bond
            |- add_or_modify_bond
            |- has_hydrogen_count
         |- Add_2HAcknowledgmentDuring the development of this package, Liu Huangrui from the South China Institute of Environmental Science offered essential support by conducting comprehensive tests on its functionality.NotePlease note that the documentation is currently a work in progress, and there is more content that is being written. I apologize for any inconvenience this may cause, but rest assured that I am continually updating the documentation to provide you with the most comprehensive guide to using transformapy.
Package: transformation-tree
Transformation Tree LibraryThis transformation tree library allows you to quickly build out possible modification paths for input data, and test various outcomes. The library also allows these pipelines and trees to be saved and loaded with ease. The library provides four major modules to build out transformation trees and pipelines, as well as provided operators and visualization tools to help build a pipeline.Links:User Documentation,Developer Documentation,Install InstructionsAuthors:CIS 422 @ University of OregonTeam BitwiseRonny Fuentes, Kyra Novitzky, Stephanie Schofield, Alec Springel, Seth TalLast modified February 10, 2021InstallationFor Users:pip install transformation-treePyPi package infoSee the documentation below for use cases and examples.For Developers:make sure python is installed and added to PATHcheck python version (>=3.7.9)make sure pip is installedclone the repository:git clone https://github.com/Sephta/time-series-modeling.gitinstall dependencies:pip install -r requirements.txtAll source code can be found within transformation_tree.Using the libraryThere are four major modules in the library:treepreprocessingforecastingstats_and_viswhich can be imported like so:from transformation_tree.tree import *
from transformation_tree.preprocessing import *
from transformation_tree.forecasting import *
from transformation_tree.stats_and_vis import *To learn how to create a transformation tree, please visit theUser Documentation.
Package: transformcl
transformcltransform angular power spectra and correlation functionsThis is a minimal Python package for transformations between angular power
spectra and correlation functions.  It is currently limited to the zero spin
case.The package can be installed using pip:pip install transformclThen import thecltoxiandxitoclfunctions from the package:from transformcl import cltoxi, xitoclFor more information, please see thedocumentation.Current functionality covers the absolutely minimal use case.  Please open an
issue on GitHub if you would like to see anything added.
Package: transformd
transformdTransform adictionaryto anotherdictionary, but keep the same shape based on aspec.What is a spec?It is a string (or sequence of strings) that specifies which "parts" of the dictionary should be included or excluded in a newdictionarythat is returned from thetransformfunction.Aspecuses dot-notation to specify how to traverse into thedictionary. It can also use indexes if the value of thedictionaryis a list.Note:Specsare applied to the originaldictionaryin the order they are defined -- thedictionarygets updated after each spec.ExamplesfromtransformdimportTransformer# Initial `dictionary` we'll transform based on a spec belowdata={"library":{"name":"Main St Library","location":{"street":"123 Main St","city":"New York City","state":"NY",},"books":[{"title":"The Grapes of Wrath","author":{"first_name":"John","last_name":"Steinbeck"},},{"title":"Slaughterhouse-Five","author":{"first_name":"Kurt","last_name":"Vonnegut"},},],}}# Only return a nested part of `data`assertTransformer(data).transform(spec="library.name")=={"library":{"name":"Main St Library"}}# Return multiple parts of `data`assertTransformer(data).transform(spec=("library.name","library.location.state"))=={"library":{"name":"Main St Library","location":{"state":"NY"},}}# Return different parts of a nested list in `data`assertTransformer(data).transform(spec=("library.books.0.title","library.books.1"))=={"library":{"books":[{"title":"The Grapes of Wrath",},{"title":"Slaughterhouse-Five","author":{"first_name":"Kurt","last_name":"Vonnegut"},},],}}# Exclude pieces from `data` by prefixing a spec with a dashassertTransformer(data).transform(spec=("-library.books","-library.location"))=={"library":{"name":"Main St Library"}}Why?I needed this functionality forUnicorn, but could not find a suitable library. After writing the code, I thought maybe it would be useful for someone else. 🤷Run testsInstallryerye syncrye run tTest Coveragerye run tcInspirationDjango Templates for the dot-notation inspirationA lot of existing JSON-related tools, but especiallyglom,jello,jq, andgron; all of which did not quite do what I wanted, but were useful on the journey
Package: transform-data-schema
transform-data-schema: simple transform and validate schematransform-data-schemais a library for converting complex datatypes, such as objects, to and from native Python datatypes.from transform_data_schema import (
    BaseSchemaTransform, 
    EXCLUDE, 
    fields, 
    transform_fields, 
    ValidationError
)


class EventJBTransformSchema(BaseSchemaTransform):
    class Meta:
        unknown = EXCLUDE

    ID = fields.Str()
    PROFILE_ID = transform_fields.NestedValueField(
        nested_key='data_event.profile_id',
        type_class=fields.Str,
        required=True
    )
    JOURNEY_ID = transform_fields.NestedValueField(
        nested_key='data_event.journey_id',
        type_class=fields.Str,
        required=True
    )
    MC_ID = transform_fields.NestedValueField(
        nested_key='data_event.master_campaign_id',
        type_class=fields.Str,
        required=True
    )
    MERCHANT_ID = transform_fields.NestedValueField(
        nested_key='data_event.merchant_id',
        type_class=fields.Str,
        required=True
    )
    DATA_TYPE = fields.Str(data_key='event_type')
    ACTION_TIME = transform_fields.NestedValueField(
        nested_key='data_event.action_time',
        type_class=transform_fields.DatetimeFromTimeStamp,
        required=True
    )
    NODE_CODE = transform_fields.NestedValueField(
        nested_key='data_event.node_code',
        type_class=fields.Str,
    )
    NODE_ID = transform_fields.NestedValueField(
        nested_key='data_event.node_id',
        type_class=fields.Str
    )

if __name__ == '__main__':
    raw_data = {
        "message_id": "19db4e86-0cef-11ed-9d73-aea73dddcfef",
        "data_event": {
            "action_time": 1658845656.471722,
            "journey_id": "1a596c15-3ccb-4d51-8d75-03223c5bce8e",
            "merchant_id": "1b99bdcf-d582-4f49-9715-1b61dfff3924",
            "node_id": "64690a9e-e807-4b2a-8da2-f2d28d085fd2",
            "node_code": "WEB_PUSH",
            "event_type": "IN_NODE",
            "profile_id": "ff5d808c-5a28-415f-b60d-9070519e7f1a",
            "master_campaign_id": "a065a9fd-2341-468b-8580-dba1cc4b3459",
            "event_id": "061dbe38-b5db-4470-a1e5-8e2ce2e14851"
        },
        "event_type": "profile_in_node"
    }
    result = EventJBTransformSchema.transform(raw_data)
    pprint(result, indent=2)
    
    """
    { 
        'ACTION_TIME': datetime.datetime(2022, 7, 26, 14, 27, 36, 471722, tzinfo=datetime.timezone.utc),
        'DATA_TYPE': 'profile_in_node',
        'JOURNEY_ID': '1a596c15-3ccb-4d51-8d75-03223c5bce8e',
        'MC_ID': 'a065a9fd-2341-468b-8580-dba1cc4b3459',
        'MERCHANT_ID': '1b99bdcf-d582-4f49-9715-1b61dfff3924',
        'NODE_CODE': 'WEB_PUSH',
        'NODE_ID': '64690a9e-e807-4b2a-8da2-f2d28d085fd2',
        'PROFILE_ID': 'ff5d808c-5a28-415f-b60d-9070519e7f1a'
    }
    """In short, transform-data-schema can be used to:Validateinput data.Deserializeinput data to app-level objects.Get It Now$ pip install -U transform-data-schemaRequirementsPython >= 3.7