django-salesforce
=================

.. image:: https://github.com/django-salesforce/django-salesforce/actions/workflows/main.yml/badge.svg
   :target: https://github.com/django-salesforce/django-salesforce/actions/workflows/main.yml

.. image:: https://badge.fury.io/py/django-salesforce.svg
   :target: https://pypi.python.org/pypi/django-salesforce

.. image:: https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue.svg
   :target: https://www.python.org/

.. image:: https://img.shields.io/badge/Django-2.1%2C%202.2%20%7C%203.0%2C%203.1%20%2C%203.2%20%7C%204.0%2C%204.1%2C%204.2%20%7C%205.0-blue.svg
   :target: https://www.djangoproject.com/

This library allows you to load, edit and query the objects in any Salesforce instance
using Django models. The integration is fairly complete, and generally seamless
for most uses. It works by integrating with the Django ORM, allowing access to
the objects in your SFDC instance (Salesforce .com) as if they were in a
traditional database.

Python 3.8 to 3.12, Django 2.1 to 5.0. (Tested also with Python 3.13b1)

Use with Django 5.0 or 4.2(LTS) currently requires an enteprise license key DJSF_LICENSE_KEY
until August 2024 unless you accept the AGPL license and install our otherwise identical
package "django-salesforce-agpl" instead. The license keys are available to sponsors.
Both versions will be unlocked automatically in Django-salesforce 5.1 when a key will be
required for Django 5.1. Use with pre-release Django versions is free.

Quick Start
-----------

Install, configure a Salesforce connection, create a Salesforce model and run.

1. **Install** django-salesforce: ``pip install django-salesforce``

2. Add a Salesforce **connection** to your ``DATABASES`` **setting**::

    'salesforce': {
        'ENGINE': 'salesforce.backend',
        'CONSUMER_KEY': '',                # 'client_id'   in OAuth2 terminology
        'CONSUMER_SECRET': '',             # 'client_secret'
        'USER': '',
        'PASSWORD': '',
        'HOST': 'https://test.salesforce.com',
    }

   In the example above, all fields should be populated as follows:

   * ``CONSUMER_KEY`` and ``CONSUMER_SECRET`` values are for the app used to
     connect to your Salesforce account. Instructions for how get these are in
     the Salesforce REST API Documentation. Key and secret can be created on
     web by:

     - SalesForce **Lightning** > Setup > Apps > App Manager > New Connected App or by
       Salesforce **Classic** > Setup > App Setup > Create > Apps > Connected apps >
       New.
     - Click "Enable OAuth Settings" in API, then select "Access and manage
       your data (api)" from available OAuth Scopes.
     - Other red marked fields must be filled, but are not relevant for Django
       with password authentication. ("Callback URL" should be a safe URL
       that maybe doesn't exist now, but its path is under your control and
       doesn't redirect. This would be important if you activate other OAuth
       mode later.)
     - SalesForce **Lightning** > Setup > Identity > OAuth and OpenID Connect Settings: Ensure that the "Allow OAuth Username-Password Flows" option is checked. This is important if you use USER/PASSWORD below, and is not the default since Summer '23.
   * ``USER`` is the username used to connect.
   * ``PASSWORD`` is a concatenation of the user's password and security token.
     Security token can be set by My Settings / Personal / Reset My Security Token
     or an new token is received by email after every password change.
     Security token can be omitted if the local IP address has been
     whitelisted in Security Controls / Network Access.
   * ``HOST`` is ``https://test.salesforce.com`` to access a sandbox, or
     ``https://login.salesforce.com`` to access production or your domain
     ``https://MyDomainName.my.salesforce.com``.

3. Add ``salesforce.router.ModelRouter`` to your ``DATABASE_ROUTERS``
   setting::

    DATABASE_ROUTERS = [
        "salesforce.router.ModelRouter"
    ]

   (This is important for switching between 'salesforce' database for
   models derived from SalesforceModel and 'default' database for normal models
   with tables created by migrations, especially for 'django.contrib'.)

4. Add the ``salesforce`` app to your ``INSTALLED_APPS`` setting::

    INSTALLED_APPS = {
        "django.contrib.auth",
        "django.contrib.contenttypes",
        ...
        ...
        "salesforce"
    }

   (This is necessary for running Salesforce extensions in the command
   ``inspectdb --database=salesforce`` in development, otherwise it is
   not important.)

5. Add a setting ``DJSF_LICENSE_KEY = "Your Name or Company / email //our.signature=="``
   if you need it for Django 5.0 or 4.2.

6. **Verify** that everything important is configured correctly by running
   the command ``python manage.py check --database=salesforce``.
   You get eventualy the important information about problems related to the previous
   steps. (clearly without tracebacks)

   That is useful again after you define your database model or if you customize your
   configuration later and e.g. you configure multiple Salesforce databases.

7. Define a **model** that extends ``salesforce.models.Model`` (alias ``SalesforceModel``)
   or export the complete SF schema by ``python manage.py inspectdb --database=salesforce``
   and simplify it to what you need. The full models file is about 1.5 MB with 500 models
   and the export takes 2 minutes, but it is a valid models module that works without
   modification. The output of command ``inspectdb`` can be restricted by a list
   of table_names on the command line, but also ForeignKey fields to omitted models
   must be pruned to get a valid complete small model.

8. **You're all done!** Just use your model like a normal Django model.

   If an error occurs in a request to Salesforce, review the received error message
   that is exactly copied between braces ``{...}`` from the
   Salesforce response to a Python exception to assist debugging.

   See also: `Information on settings up Salesforce connected apps
   <https://help.salesforce.com/apex/HTViewHelpDoc?id=connected_app_create.htm>`_
   if necessary.

   **Note about permissions**: Administrator profile are only required to run
   the full suite of unit tests of this framework; otherwise, as long as
   the account has rights to read or modify the chosen object, everything
   should work properly. Introspection by ``inspectdb`` doesn't require any
   additional object permissions.

Optional small features
-----------------------

-  **Salesforce alias** If you want to use another name for your Salesforce DB
   connection, define ``SALESFORCE_DB_ALIAS`` in your settings file::

    SALESFORCE_DB_ALIAS = 'salesforce'  # default

-  **Timeout settings** To override the default timeout of 15 seconds,
   define ``SALESFORCE_QUERY_TIMEOUT`` in your settings file.
   It can be one number or better a tuple with a short value for connection
   timeout and a longer value that includes time for running a query.
   It never need be longer than 30 seconds::

    SALESFORCE_QUERY_TIMEOUT = (4, 15)  # default (connect timeout, data timeout)

-  **Automatic stupid admin** Create a normal Django ``admin.py`` module for your Salesforce models
   and you can register a minimalistic admin for all omitted Admin classes::

    from salesforce.testrunner.example.universal_admin import register_omitted_classes
    # some admin classes that you wrote manually yet
    # ...
    # end of file
    register_omitted_classes(your_application.models)

   This is a rudimentary way to verify that every model works in a sandbox, before
   hand-writing all admin classes. (Foreign keys to huge tables in the production
   require a customized admin e.g. with search widgets.)

-   **Lazy connect** By default, the Django ORM connects to all DBs at startup. To delay
    SFDC connections until they are actually required, define ``SF_LAZY_CONNECT=True``
    in your settings file. Be careful when using this setting; since it won't fail during
    the application boot, it's possible for a bad password to be sent repeatedly,
    requiring an account reset to fix.

-  **Configurable Primary Key**
   Salesforce doesn't allow you to define custom primary keys, so django-salesforce
   will add them automatically in all cases. You can override only capitalization and use
   a primary key ``Id`` by configuring ``SF_PK='Id'`` in your project settings
   if you prefer Salesforce capitalized field name conventions instead of Django
   default ``id``.

Advanced usage
--------------
-  **Multiple Inheritance from Abstract Models** - Many Salesforce models use
   the same sets of fields, but using a single inheritance tree would be too
   complicated and fragile. Proxy models and mixins are also supported.

-  **Testing** - By default, tests will be run against the SFDC connection
   specified in settings.py, which will substantially increase testing time.

   One way to speed this up is to change the SALESFORCE_DB_ALIAS to point to
   another DB connection (preferably SQLite) during testing using the
   ``TEST`` settings variable. Such simple tests can run without any network
   access. Django unit tests without SalesforceModel are fast everytimes.
   Special read only fields (with ``sf_read_only=...``) that are updated only by SFDC
   e.g. ``last_modified_date`` need more parameters to be possible to save them
   into an alternate database, e.g. by ``auto_now=True`` or to play with
   ``null=True`` or ``default=...``.

-  **Multiple SFDC connections** - In most cases, a single connection is all
   that most apps require, so the default DB connection to use for Salesforce
   is defined by the ``SALESFORCE_DB_ALIAS`` settings variable. This behavior
   can be also configured by ``DATABASE_ROUTERS``, replacing the use of
   salesforce.router.ModelRouter.

-  **Non SF databases** - If ``SALESFORCE_DB_ALIAS`` is set to a conventional
   database, the tables defined by the SF models will be created by ``migrate``. This
   behavior can be disabled by adding a Meta class with ``managed=False``.

-  **Custom Managers** - When creating a custom manager for a model, the manager
   must be a descendant of ``salesforce.manager.SalesforceManager``.

   In most cases, switching DB connections with ``.using(alias).`` will be
   sufficient, but if you need to call a method on your custom manager, you should
   instead use ``.db_manager(alias)`` to select a DB while returning the correct
   manager, e.g. ``Contact.objects.db_manager(alias).my_manager(params...)``

-  **Automatic Field Naming** - Most of database columns names can be automatically
   deduced from Django field name, if no ``db_column`` is specified::

     last_name = models.CharField(max_length=80)     # db_column='LastName'
     FirstName = models.CharField(max_length=80)     # db_column='FirstName'
     my_bool = models.BooleanField(custom=True)      # db_column='MyBool__c'

   Fields named with an upper case character are never modified, except for the
   addition of the namespace prefix or the '__c' suffix for custom fields.
   If you want models with minimal db_column then read
   `Running inspectdb <https://github.com/django-salesforce/django-salesforce/wiki/Introspection-and-Special-Attributes-of-Fields#running-inspectdb>`__.

-  **Query deleted objects** - Deleted objects that are in trash bin are
   not selected by a normal queryset, but if a special method ``query_all``
   is used then also deleted objects are searched.
   If a trash bin is supported by the model then a boolean field ``IsDeleted``
   can be in the model and it is possible to select only deleted objects ::

     deleted_list = list(Lead.objects.filter(IsDeleted=True).query_all())

-  **Migrations** - Migrations can be used for an alternate test database
   with SalesforceModel. Then all tables must have Meta options ``db_table``
   and fields must have option ``db_column``, which is done by ``inspectdb``
   with default settings. Models exported by introspection ``inspectdb``
   do not specify the option ``managed`` because the default value is True.

   There is probably no reason now to collect old migrations of an application
   that uses only SalesforceModel if they are related to data stored only in Salesforce.
   Such old migrations can be easily deleted and a new initial migration can be
   created again if it would be necessary for offline tests if that migrations
   directory seems big and obsoleted.

-  **Exceptions** - Custom exceptions instead of standard Django database
   exceptions are raised by Django-Salesforce to get more useful information.
   General exceptions are ``SalesforceError`` or a more general custom
   ``DatabaseError``. They can be imported from ``salesforce.dbapi.exceptions``
   if database errors should be handled specifically in your app.

Foreign Key Support
-------------------
Foreign key relationships should work as expected, especially relationships
from child to parents are well supported in querysets, but mapping
Salesforce SOQL to a purely-relational mapper is a leaky abstraction
and some knowledge about limitations of SOQL is useful. Some rejected
queries should be usually rewritten to two simpler queries.
For the gory details, see
`Foreign Key Support <https://github.com/django-salesforce/django-salesforce/wiki/Foreign-Key-Support>`__
on the Django-Salesforce wiki.

Introspection and special attributes of fields
----------------------------------------------
Some Salesforce fields can not be fully used without special attributes, namely
read-only fields and some default values. Further details can be found in
`Introspection and Special Attributes of Fields <https://github.com/django-salesforce/django-salesforce/wiki/Introspection-and-Special-Attributes-of-Fields>`__

Caveats
-------

The ultimate goal of development of this package is to support reasonable
new features of the Salesforce platform and of new Django versions,
but for now here are the potential pitfalls and unimplemented operations:

-  **Large Objects** — Since the entire result set needs to be transferred
   over HTTP, and since it's common to have extremely high column counts
   on full object queries, it's assumed that users will create models that
   are specific to their individual applications' needs. It is especially
   important if migrations should be created. Migrations on the full models
   module are really slow. (Models that have been included with this library are
   very simplified only for example and documentation purposes and for tests.)
-  **Inheritance** — When using the default router, all models Salesforce
   must extend salesforce.models.SalesforceModel. The model router checks
   for this to determine which models to handle through the Salesforce
   connection.
-  **Database Migrations** — ``migrate`` will create new tables only in non-SF
   databases (useful for unit tests); SFDC tables are assumed to already
   exist with the appropriate permissions. (A very incomplete implementation
   of migrations in Salesforce has been in a development repository around
   for two years. I am satisfied for my purposes. Development for better
   general usability is the main reason why am I trying to get sponsors.)

-  **Unsupported methods**: Queryset methods ``union()``, ``difference()``,
   ``intersection()`` and ``distinct()``
   are e.g. not supported because SOQL doesn't support corresponding operators:
   UNION, EXCEPT, INTERSECT and DISTINCT.

Backwards-incompatible changes
------------------------------

The last most important:

-  v5.0.2: Removed support for Python 3.7 and Django 2.0

-  v4.2: Some new features or versions implemented after June 2023 can require a license key
   (sponsorship) or to accept the AGPL license. (AGPL is fine for exclusive open source
   contribution or for education, but impossible if you do not share all your
   source codes.)
   Removed support for Python 3.6


# VPython

This package enables one to run VPython in a browser, using the GlowScript
VPython API, documented in the Help at https://www.glowscript.org. If the code is
in a cell in a Jupyter notebook, the 3D scene appears in the Jupyter notebook.
If the code is launched outside a notebook (e.g. from the command line), a
browser window will open displaying the scene.

VPython makes it unusually easy to create navigable real-time 3D animations.
The one-line program "sphere()" produces a 3D sphere with appropriate lighting
and with the camera positioned so that the scene fills the view. It also
activates mouse interactions to zoom and rotate the camera view. This
implementation of VPython was begun by John Coady in May 2014. Ruth Chabay,
Matt Craig, and Bruce Sherwood are assisting in its further development.

## Installation

For more detailed instructions on how to install vpython, see https://vpython.org, where you will also find a link to the VPython forum, which is a good place to report issues and to request assistance.

Briefly:

+ If you use the [anaconda python distribution](https://www.continuum.io/anaconda-overview), install like this: `conda install -c vpython vpython`
+ If you use any other python distribution, install this way: `pip install vpython`

## Sample program

Here is a simple example:

```python
from vpython import *
sphere()
```

This will create a canvas containing a 3D sphere, with mouse and touch
controls available to zoom and rotate the camera:

    Right button drag or Ctrl-drag to rotate "camera" to view scene.
    To zoom, drag with middle button or Alt/Option depressed, or use scroll wheel.
         On a two-button mouse, middle is left + right.
    Shift-drag to pan left/right and up/down.
    Touch screen: pinch/extend to zoom, swipe or two-finger rotate.

Currently, to re-run a VPython program in a Jupyter notebook you need to click the circular arrow icon to "restart the kernel" and then click the red-highlighted button, then click in the first cell, then click the run icon. Alternatively, if you insert `scene = canvas()` at the start of your program, you can rerun the program without restarting the kernel.

Run example VPython programs: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/vpython/vpython-jupyter/7.6.1?filepath=index.ipynb)

## Installation for developers from package source

You should install Cython (`conda install cython` or `pip install cython`) so
that the fast version of the vector class can be generated and compiled. You
may also need to install a compiler (command line tools on Mac, community
edition on Visual Studio on Windows).

If you don't have a compilier vpython should still work, but code that
generates a lot of vectors may run a little slower.

To install vpython from source run this command from the source directory
after you have downloaded it:

```
pip install -e .
```

The `-e` option installs the code with symbolic links so that change you make
show up without needing to reinstall.

If you also need the JupyterLab extension, please see the instructions
in the `labextension` folder.

## vpython build status (for the vpython developers)

![Testing workfloww](https://github.com/vpython/vpython-jupyter/actions/workflows/build.yml/badge.svg)

## Working with the source code

Here is an overview of the software architecture:

https://vpython.org/contents/VPythonArchitecture.pdf

The vpython module uses the GlowScript library (vpython/vpython_libraries/glow.min.js). The GlowScript repository is here:

https://github.com/vpython/glowscript

In the GlowScript repository's docs folder, GlowScriptOverview.txt provides more details on the GlowScript architecture.

Here is information on how to run GlowScript VPython locally, which makes possible testing changes to the GlowScript library:

https://www.glowscript.org/docs/GlowScriptDocs/local.html

If you execute build_original_no_overload.py, and change the statement "if True:" to "if False", you will generate into the ForInstalledPython folder an un-minified glow.min.js which can be copied to site-packages/vpython/vpython_libraries and tested by running your test in (say) idle or spyder. (Running in Jupyter notebook or Jupyterlab requires additional fiddling.)

Note that in site-packages/vpython/vpython_libraries it is glowcomm.html that is used by launchers such as idle or spyder; glowcomm.js is used with Jupyter notebook (and a modified version is used in Jupyterlab).

Placing console.log(....) statements in the GlowScript code or in the JavaScript section of glowcomm.html can be useful in debugging. You may also need to put debugging statements into site-packages/vpython/vpython.py.


Picasso
=======
.. image:: https://readthedocs.org/projects/picassosr/badge/?version=latest
   :target: https://picassosr.readthedocs.io/en/latest/?badge=latest
   :alt: Documentation Status

.. image:: https://github.com/jungmannlab/picasso/workflows/CI/badge.svg
   :target: https://github.com/jungmannlab/picasso/workflows/CI/badge.svg
   :alt: CI

.. image:: http://img.shields.io/badge/DOI-10.1038/nprot.2017.024-52c92e.svg
   :target: https://doi.org/10.1038/nprot.2017.024
   :alt: CI

.. image:: https://static.pepy.tech/personalized-badge/picassosr?period=total&units=international_system&left_color=black&right_color=brightgreen&left_text=Downloads
 :target: https://pepy.tech/project/picassosr

.. image:: main_render.png
   :width: 750
   :height: 564
   :alt: UML Render view

A collection of tools for painting super-resolution images. The Picasso software is complemented by our `Nature Protocols publication <https://www.nature.com/nprot/journal/v12/n6/abs/nprot.2017.024.html>`__.
A comprehensive documentation can be found here: `Read the Docs <https://picassosr.readthedocs.io/en/latest/?badge=latest>`__.

Picasso 0.6.1
-------------
In previous version, the rotation window (3D Render) showed an incorrect length of the scalebar. This has been fixed.

Picasso 0.6.0
-------------
RESI dialog added to Picasso Render, allowing for substantial boost in spatial resolution (*Reinhardt, et al., Nature, 2023.* DOI: 10.1038/s41586-023-05925-9).

Previous versions
-----------------
To see all changes introduced in previous versions, click `here <https://github.com/jungmannlab/picasso/blob/master/changelog.rst>`_.

Installation
------------

Check out the `Picasso release page <https://github.com/jungmannlab/picasso/releases/>`__ to download and run the latest compiled one-click installer for Windows. Here you will also find the Nature Protocols legacy version.

For the platform-independent usage of Picasso (e.g., with Linux and Mac Os X), please follow the advanced installation instructions below.

Other installation modes (Python 3.10)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As an alternative to the stand-alone program for end-users, Picasso can be installed as a Python package. This is the preferred option to use Picasso’s internal routines in custom Python programs. Those can be imported by running, for example, ``from picasso import io`` (see the "Example usage" tab below) to use input/output functions from Picasso. For windows, it is still possible to use Picasso as an end-user by creating the respective shortcuts. This allows Picasso to be used on the same system by both programmers and end-users.

Via PyPI
^^^^^^^^

1. Open the console/terminal and create a new conda environment: ``conda create --name picasso python=3.10``
2. Activate the environment: ``conda activate picasso``.
3. Install Picasso package using: ``pip install picassosr``.
4. You can now run any Picasso function directly from the console/terminal by running: ``picasso render``, ``picasso localize``, etc, or import Picasso functions in your own Python scripts.

For Developers
^^^^^^^^^^^^^^

If you wish to use your local version of Picasso with your own modifications:

1. Open the console/terminal and create a new conda environment: ``conda create --name picasso python=3.10``
2. Activate the environment: ``conda activate picasso``.
3. Change to the directory of choice using ``cd``.
4. Clone this GitHub repository by running ``git clone https://github.com/jungmannlab/picasso``. Alternatively, `download <https://github.com/jungmannlab/picasso/archive/master.zip>`__ the zip file and unzip it.
5. Open the Picasso directory: ``cd picasso``.
6. You can modify Picasso code in this directory.
7. To create a *local* Picasso package to use it in other Python scripts, run ``pip install -e .``. When you change the code in the ``picasso`` directory, the changes will be reflected in the package.
8. You can now run any Picasso function directly from the console/terminal by running: ``picasso render``, ``picasso localize``, etc, or import Picasso functions in your own Python scripts.

Optional packages
^^^^^^^^^^^^^^^^^

Regardless of whether Picasso was installed via PyPI or by cloning the GitHub repository, some packages may be additionally installed to allow extra functionality:

- ``pip install pyinstaller`` if you plan to additionally compile your own installer with `Pyinstaller <https://pyinstaller.org/en/stable/>`__.
- *(Windows only)* ``pip install PyImarisWriter==0.7.0`` to enable .ims files in Localize and Render. Note that ``PyImarisWriter`` has been tested only on Windows.
- To enable ``GPU fitting``, follow instructions on `Gpufit <https://github.com/gpufit/Gpufit>`__ to install the Gpufit python library in your conda environment. In practice, this means downloading the zipfile and installing the Python wheel. Picasso Localize will automatically import the library if present and enables a checkbox for GPU fitting when selecting the LQ-Method.

Updating
^^^^^^^^

If Picasso was installed from PyPI, run the following command:

``pip install --upgrade picassosr``

Creating shortcuts on Windows (*optional*)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Run the PowerShell script “createShortcuts.ps1” in the gui directory. This should be doable by right-clicking on the script and choosing “Run with PowerShell”. Alternatively, run the command
``powershell ./createShortcuts.ps1`` in the command line. Use the generated shortcuts in the top level directory to start GUI components. Users can drag these shortcuts to their Desktop, Start Menu or Task Bar.

Example Usage
-------------

Besides using the GUI, you can use picasso like any other Python module. Consider the following example:::

  from picasso import io, postprocess

  path = 'testdata_locs.hdf5'
  locs, info = io.load_locs(path)
  # Link localizations and calcualte dark times
  linked_locs = postprocess.link(picked_locs, info, r_max=0.05, max_dark_time=1)
  linked_locs_dark = postprocess.compute_dark_times(linked_locs)

  print('Average bright time {:.2f} frames'.format(np.mean(linked_locs_dark.n)))
  print('Average dark time {:.2f} frames'.format(np.mean(linked_locs_dark.dark)))

This codeblock loads data from testdata_locs and uses the postprocess functions programmatically.

Jupyter Notebooks
-----------------

Check picasso/samples/ for Jupyter Notebooks that show how to interact with the Picasso codebase.

Contributing
------------

If you have a feature request or a bug report, please post it as an issue on the GitHub issue tracker. If you want to contribute, put a PR for it. You can find more guidelines for contributing `here <https://github.com/jungmannlab/picasso/blob/master/CONTRIBUTING.rst>`__. We will gladly guide you through the codebase and credit you accordingly. Additionally, you can check out the ``Projects``-page on GitHub.  You can also contact us via picasso@jungmannlab.org.

Contributions & Copyright
-------------------------

| Contributors: Joerg Schnitzbauer, Maximilian Strauss, Rafal Kowalewski, Adrian Przybylski, Andrey Aristov, Hiroshi Sasaki, Alexander Auer, Johanna Rahm
| Copyright (c) 2015-2019 Jungmann Lab, Max Planck Institute of Biochemistry
| Copyright (c) 2020-2021 Maximilian Strauss
| Copyright (c) 2022-2023 Rafal Kowalewski

Citing Picasso
--------------

If you use picasso in your research, please cite our Nature Protocols publication describing the software.

| J. Schnitzbauer*, M.T. Strauss*, T. Schlichthaerle, F. Schueder, R. Jungmann
| Super-Resolution Microscopy with DNA-PAINT
| Nature Protocols (2017). 12: 1198-1228 DOI: `https://doi.org/10.1038/nprot.2017.024 <https://doi.org/10.1038/nprot.2017.024>`__

Credits
-------

-  Design icon based on “Hexagon by Creative Stalls from the Noun
   Project”
-  Simulate icon based on “Microchip by Futishia from the Noun Project”
-  Localize icon based on “Mountains by MONTANA RUCOBO from the Noun
   Project”
-  Filter icon based on “Funnel by José Campos from the Noun Project”
-  Render icon based on “Paint Palette by Vectors Market from the Noun
   Project”
-  Average icon based on “Layers by Creative Stall from the Noun
   Project”
-  Server icon based on “Database by Nimal Raj from NounProject.com”


[![build status](https://github.com/vprusso/toqito/actions/workflows/build-test-actions.yml/badge.svg?style=plastic)](https://github.com/vprusso/toqito/actions/workflows/build-test-actions.yml)
[![doc status](https://readthedocs.org/projects/toqito/badge/?version=latest&style=plastic)](https://toqito.readthedocs.io/en/latest/)
[![codecov](https://codecov.io/gh/vprusso/toqito/branch/master/graph/badge.svg?style=plastic)](https://codecov.io/gh/vprusso/toqito)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4743211.svg)](https://doi.org/10.5281/zenodo.4743211)
[![Downloads](https://static.pepy.tech/personalized-badge/toqito?style=platic&period=total&units=none&left_color=black&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/toqito)
[![Unitary Fund](https://img.shields.io/badge/Supported%20By-UNITARY%20FUND-brightgreen.svg?style=plastic)](http://unitary.fund)

 <picture>
   <source media="(prefers-color-scheme: dark)" srcset="https://github.com/vprusso/toqito/raw/cfb62c4a5ce04b782f64229e7acd2b1c97f09801/docs/figures/logo.svg" width="60%">

 </picture>

# toqito: Theory of Quantum Information Toolkit

The `toqito` package is an open-source Python library for studying various
objects in quantum information, namely, states, channels, and measurements.

Specifically, `toqito` focuses on providing numerical tools to study problems
about entanglement theory, nonlocal games, matrix analysis, and other
aspects of quantum information that are often associated with computer science.

`toqito` aims to fill the needs of quantum information researchers who want
numerical and computational tools for manipulating quantum states,
measurements, and channels. It can also be used as a tool to enhance the
experience of students and instructors in classes about quantum
information.

## Getting Started

toqito is available via [PyPi](https://pypi.org/project/toqito/) for Linux, and macOS, with support for Python 3.10 to 3.12.

```console
(venv) $ pip install toqito
```

The following code gives an example on the usage:

```python
# Calculate the classical and quantum value of the CHSH game.
import numpy as np
from toqito.nonlocal_games.xor_game import XORGame

# The probability matrix.
prob_mat = np.array([[1/4, 1/4], [1/4, 1/4]])

# The predicate matrix.
pred_mat = np.array([[0, 0], [0, 1]])

# Define CHSH game from matrices.
chsh = XORGame(prob_mat, pred_mat)

chsh.classical_value()
# 0.75
chsh.quantum_value()
# 0.8535533

```

**Detailed documentation on all available methods, options, and input formats is available at [ReadTheDocs](https://toqito.readthedocs.io/en/latest/).**

## Using

Full documentation along with specific examples and tutorials are provided here:
[https://toqito.readthedocs.io/](https://toqito.readthedocs.io/).

More information can also be found on the following
[toqito homepage](https://vprusso.github.io/toqito/).

Chat with us in our `toqito` channel on [Discord](http://discord.unitary.fund/).

## Testing

The `pytest` module is used for testing. To run the suite of tests for `toqito`,
run the following command in the root directory of this project.

```
pytest --cov-report term-missing --cov=toqito
```

## Citing

You can cite `toqito` using the following DOI:
10.5281/zenodo.4743211

If you are using the `toqito` software package in research work, please include
an explicit mention of `toqito` in your publication. Something along the lines
of:

```
To solve problem "X" we used `toqito`; a package for studying certain
aspects of quantum information.
```

A BibTeX entry that you can use to cite `toqito` is provided here:

```bib
@misc{toqito,
   author       = {Vincent Russo},
   title        = {toqito: A {P}ython toolkit for quantum information, version 1.0.0},
   howpublished = {\url{https://github.com/vprusso/toqito}},
   month        = May,
   year         = 2021,
   doi          = {10.5281/zenodo.4743211}
 }
```

## References

The `toqito` project has been used or referenced in the following works:

- [![a](https://img.shields.io/static/v1?label=arXiv&message=2307.2551&color=inactive&style=flat-square)](https://arxiv.org/abs/2307.02551) Tavakoli, Armin and Pozas-Kerstjens, Alejandro and Brown, Peter and Araújo, Mateus
"Semidefinite programming relaxations for quantum correlations", (2023).

- [![a](https://img.shields.io/static/v1?label=arXiv&message=2311.17047&color=inactive&style=flat-square)](https://arxiv.org/abs/2311.17047) Johnston, Nathaniel and Russo, Vincent and Sikora, Jamie
"Tight bounds for antidistinguishability and circulant sets of pure quantum states", (2023).

- [![a](https://img.shields.io/static/v1?label=arXiv&message=2308.15579&color=inactive&style=flat-square)](https://arxiv.org/abs/2308.15579) Pelofske, Elijah and Bartschi, Andreas and Eidenbenz, Stephan and Garcia, Bryan and Kiefer, Boris
"Probing Quantum Telecloning on Superconducting Quantum Processors", (2023).

- [![a](https://img.shields.io/static/v1?label=arXiv&message=2303.07911&color=inactive&style=flat-square)](https://arxiv.org/abs/2303.07911) Philip, Aby and Rethinasamy, Soorya and Russo, Vincent and Wilde, Mark.
"Quantum Steering Algorithm for Estimating Fidelity of Separability.", (2023).

- [![a](https://img.shields.io/static/v1?label=arXiv&message=2302.09401&color=inactive&style=flat-square)](https://arxiv.org/abs/2302.09401) Miszczak, Jarosław Adam.
"Symbolic quantum programming for supporting applications of quantum computing technologies.", (2023).

- [![a](https://img.shields.io/static/v1?label=arXiv&message=2306.09444&color=inactive&style=flat-square)](https://arxiv.org/abs/2306.09444) Casalé, Balthazar and Di Molfetta, Giuseppe and Anthoine, Sandrine and Kadri, Hachem.
"Large-Scale Quantum Separability Through a Reproducible Machine Learning Lens.", (2023).

- [![a](https://img.shields.io/static/v1?label=arXiv&message=2206.08313&color=inactive&style=flat-square)](https://arxiv.org/abs/2206.08313) Russo, Vincent and Sikora, Jamie "Inner products of pure states and their antidistinguishability", Physical Review A, Vol. 107, No. 3, (2023).

## Contributing

All contributions, bug reports, bug fixes, documentation improvements,
enhancements, and ideas are welcome.

A detailed overview of how to contribute can be found in the
[contributing guide](https://toqito.readthedocs.io/en/latest/getting_started.html#contributing).

## License

[MIT License](http://opensource.org/licenses/mit-license.php>)


[![GitHub license](https://img.shields.io/github/license/materialsvirtuallab/monty)](https://github.com/materialsvirtuallab/monty/blob/main/LICENSE)
[![Linting](https://github.com/materialsvirtuallab/monty/workflows/Linting/badge.svg)](https://github.com/materialsvirtuallab/monty/workflows/Linting/badge.svg)
[![Testing](https://github.com/materialsvirtuallab/monty/workflows/Testing/badge.svg)](https://github.com/materialsvirtuallab/monty/workflows/Testing/badge.svg)
[![Downloads](https://static.pepy.tech/badge/monty)](https://pepy.tech/project/monty)
[![codecov](https://codecov.io/gh/materialsvirtuallab/monty/branch/master/graph/badge.svg?token=QdfT2itxgu)](https://codecov.io/gh/materialsvirtuallab/monty)

# Monty: Python Made Even Easier

Monty is the missing complement to Python. Monty implements supplementary
useful functions for Python that are not part of the standard library.
Examples include useful utilities like transparent support for zipped files,
useful design patterns such as singleton and cached_class, and many more.

Python is a great programming language and comes with "batteries
included". However, even Python has missing functionality and/or quirks that
make it more difficult to do many simple tasks. In the process of
creating several large scientific frameworks based on Python,
my co-developers and I have found that it is often useful to create
reusable utility  functions to supplement the Python standard library. Our
forays in various developer sites and forums also found that many developers
are looking for solutions to the same problems.

Monty is created to serve as a complement to the Python standard library. It
provides suite of tools to solve many common problems, and hopefully,
be a resource to collect the best solutions.

Monty supports Python 3.x.

Please visit the [official docs](https://materialsvirtuallab.github.io/monty) for more information.


[![Code Climate](https://codeclimate.com/github/agdsn/sipa/badges/gpa.svg)](https://codeclimate.com/github/agdsn/sipa)

SIPA - Supreme Information Providing Application
================================================

Name
----

Just as SIPA stands for a ball over the net game[1], the lesser known
**S**upreme **I**nformation **P**roviding **A**pplication does just the same --
sending packets over the internet.

This project is a flask-based webserver developed by members of the student
network Dresden.

Usage
-----

Please note that SIPA has been built to fit our specific purposes.  This means
that there will be features you probably won't need, such as the traffic
monitoring.

How can I run Sipa?
-------------------

As a general note, you should have `docker` and `docker-compose`
installed.

The simplest method is to run `docker-compose -f build/dev/docker-compose.yml
up -d`.

This should automatically set up an nginx container on port 80
providing `/sipa` and `/sipa_debug`, which are two containers of sipa,
the first running on uwsgi, and the second directly using `sipa.py`.

If this does not work for you see “Running on Docker” below for a
manual (i.e. not docker-compose-based) container setup.

To run SIPA wihout Docker you can do the following:

```shell
# Create an venv
python -m venv venv

# Activate the venv
. venv/bin/activate[.fish|.csh]

# Install the dependencies
sudo apt install libpq-dev  # For Debian based distributions
pip install -r requirements.txt

# Run SIPA with flask
flask run
```

## Is there any more documentation?

Sipa provides documentation via sphinx (ergo, docstrings).  At the
moment, there is no automatic pushing
to [here](https://agdsn.github.io/sipa/), so you need to do it locally
by running `make docs` and `make show_docs`, which opens an http
server at `docs/build/html`.

### Editing documentation

The documentation is defined in rst files in `docs/src`.  The largest
part consists of automatic inclusion of module documentation using
`.. automodule::`.

How can I run the tests?
------------------------

For testing, there exists the docker-compose file `build/testing/docker-compose.yml`:

```shell
docker-compose -f build/testing/docker-compose.yml up -d
docker-compose -f build/testing/docker-compose.yml run --rm sipa_testing pytest -v
```

…ore choose any other testing command you wish.  For example, you can
execute a single test case using `nosetests -v
tests.integration.test_hss_ldap:HssLdapPasswordTestCase`

Running on Docker
-----------------

To build the image, `cd` into your instance of sipa (which contains the
`Dockerfile`) and run

```shell
docker build -t sipa .
```

Now, you have basically two possibilities to use sipa:

- Using uwsgi: This is the standard option. Just run:

```shell
docker run --name sipa -d sipa
```

Note that in order to use above example, you have to use another docker
container, i.e. an nginx instance, which is linked to the `sipa` container. If
you don't want to do this, you have to expose port 5000 adding `-p 5000:5000` as
a parameter.

- Using http: This is an option you have to envoke manually. To use it, run

```shell
docker run --name sipa -p 5000:5000 -d sipa python sipa.py --exposed
```

If you want to use sipa for development, adding `--debug` after `sipa.py` and
mounting your sipa folder using `-v <path>:/home/sipa/sipa` is recommended.

### Running with a prefix

If you run sipa under something else than `/`, *make sure you specify this* during `docker run`!

Instead of the default `uwsgi --ini uwsgi.ini`, you will have to use
`uwsgi --ini uwsgi.ini:prefixed --set-ph prefix=/mountpoint`

## Configuration ##

### Environment variables ###

The default config (`sipa.default_config`) reads environment variables
for the most cases.

### Local Python config file ###

If one prefers to write configuration into a file locally, sipa reads
`/config.py`.  If the environment variable `SIPA_CONFIG_FILE` is set,
its path is taken instead.

### Logging ###

In order to provide an additional logfile, set the app's `LOG_CONFIG`
variable in your local configuration file.

It has to be set to a dict usable by `dictConfig()`.  For further
documentation, see [the python docs](https://docs.python.org/3/howto/logging-cookbook.html#an-example-dictionary-based-configuration).

Also, you might want to look into `sipa.defaults.DEFAULT_CONFIG` for the current structure.

Keep in mind you don't need to rewrite the whole default configuration
every time, since you can include `'incremental': True` in said dict.

## Translations

Sipa uses [flask-babel](https://python-babel.github.io/flask-babel/) for
translations.  To update translations, You should have pybabel and
poedit installed (via pip or any other way), and run `make translate`.
Since unfortunately, the build proocess is not automated (or done at
the start), you need to check in the changes to the compiled files
yourself.

Required format for the markdown files
--------------------------------------

In the folder `content/` you can place markdown files to use them as *content
pages* as well as *news*.  The folder structure has to look like this, following
the conditions explained below:

    content
    ├── images
    │   ├── image.png
    │   └── logo.png
    ├── legal
    │   ├── impressum.de.md
    │   ├── impressum.en.md
    │   ├── index.de.md
    │   └── index.en.md
    ├── news
    │   ├── 2015-03-11-new_website.de.md
    │   ├── 2015-03-11-new_website.en.md
    │   ├── index.de.md
    │   └── index.en.md
    └── support
        ├── contacts.de.md
        ├── contacts.en.md
        ├── faq.de.md
        ├── faq.en.md
        ├── index.de.md
        └── index.en.md

The *navigation bar* is built by scanning every directory for `*.md`-files.
Directories containing the latter are then expected to contain an index file for
every language code, e.g. `index.en.md` These index files decide whether it will
appear in the navigation bar and which title it will be displayed with.

The index files have to contain certain metadata in the form `property:
value`. This metadata section is terminated by an empty line (`\n\n`)

* To *not* include a folder in the menu, set `index: false`, as you will need
  for the `news/` folder(!).

* To *include* a folder, set the title of the navigation bar with `name:` as
  well as its position with `rank`.  Do not forget to set `index: true`
  explicitly.

If the parameter `index` does not exist, the corresponding folder will not
appear in the navigation bar, although every folder containing a markdown file
*must* contain an `index.xx.md` file.

The markdown files must have a header in the same fashion as the index files. A
complete .md file can look like this:

    title: Stuff
    author: alice
    date: 2015-03-27
    icon: bi-person

    ### Stuff
    #### Part 1

    To do stuff, you have to do stuff first.

Another possibility is to include hyperlinks, which only have a metadata
section:

    title: Awesome page
    icon: bi-emoji-smile
    link: https://example.org/
    rank: 1

Translations
------------
Make sure you installed `Babel` via pip. Then, just run `make translate`.

[1] https://en.wikipedia.org/wiki/Sipa


![banner](https://raw.githubusercontent.com/androguard/androguard/master/assets/web/androguardwithname.jpg)

# Androguard

[![PyPI Upload](https://github.com/androguard/androguard/actions/workflows/pythonpublish.yml/badge.svg)](https://github.com/androguard/androguard/actions/workflows/pythonpublish.yml)
![PyPI - Version](https://img.shields.io/pypi/v/androguard)
![Static Badge](https://img.shields.io/badge/Documentation-InProgress-red)

## Installation
Quick installation:
~~~~
pip install androguard
~~~~

> [!IMPORTANT]
> Versions >= 4.0.0 are new releases after a long time, where the project has substantial differences from the previous stable version 3.3.5 from 2019. This means that certain functionalities have been removed. If you notice an issue with your project using the latest version, please open up an [issue](https://github.com/androguard/androguard/issues).

## Documentation
**Documentation contains outdated information - In progress of updating**

The [wiki](https://github.com/androguard/androguard/wiki) page is the most recently updated source.

Additional documentation that contains outdated information is available at [ReadTheDocs](http://androguard.readthedocs.io/en/latest/).

## Features

Androguard is a full python tool to play with Android files.

* DEX, ODEX
* APK
* Android's binary xml
* Android resources
* Disassemble DEX/ODEX bytecodes
* Basic Decompiler for DEX/ODEX files
* Frida support for easy dynamic analysis
* SQLite database to save the session

## Authors: Androguard Team

Androguard + tools: Anthony Desnos (desnos at t0t0.fr).

DAD (DAD is A Decompiler): Geoffroy Gueguen (geoffroy dot gueguen at gmail dot com)

## Projects using Androguard
In alphabetical order

* [AndroPyTool](https://github.com/alexMyG/AndroPyTool)
* [AppKnox](http://appknox.com)
* [Cuckoo Sandbox](https://cuckoosandbox.org)
* [Deckard](https://github.com/hrkfdn/deckard)
* [Droidbot](https://github.com/honeynet/droidbot)
* [Droidstatx](https://github.com/integrity-sa/droidstatx)
* [εxodus](https://github.com/Exodus-Privacy/exodus)
* [F-Droid Server](https://gitlab.com/fdroid/fdroidserver)
* [gplaycli](https://github.com/matlink/gplaycli)
* [Koodous](https://koodous.com)
* [MobSF](https://github.com/MobSF/Mobile-Security-Framework-MobSF)
* [qiew](https://github.com/mtivadar/qiew)
* [Quark-Engine](https://github.com/quark-engine/quark-engine)
* [Virustotal](https://virustotal.readme.io/reference/androguard)
* [Viper Framework](https://github.com/viper-framework/viper)
* ... and many more!

You are using Androguard and are not listed here? Just create a [ticket](https://github.com/androguard/androguard/issues) or send us a [pull request](https://github.com/androguard/androguard/pulls) with your project!

## Licenses

### Androguard

Copyright (C) 2012 - 2024, Anthony Desnos (desnos at t0t0.fr)
All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

### DAD

Copyright (C) 2012 - 2016, Geoffroy Gueguen (geoffroy dot gueguen at gmail dot com)
All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


# Ghostwriter

[![Sponsored by SpecterOps](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fspecterops%2F.github%2Fmain%2Fconfig%2Fshield.json&style=flat)](https://github.com/specterops#ghostwriter)

[![Python Version](https://img.shields.io/badge/Python-3.10-brightgreen.svg)](.) [![Django Verison](https://img.shields.io/badge/Django-3.2-006400)](.) [![License](https://img.shields.io/badge/License-BSD3-darkred.svg)](.) ![GitHub Release (Latest by Date)](https://img.shields.io/github/v/release/GhostManager/Ghostwriter?label=Latest%20Release) ![GitHub Release Date](https://img.shields.io/github/release-date/ghostmanager/ghostwriter?label=Release%20Date&color=blue)

[![CodeFactor](https://img.shields.io/codefactor/grade/github/GhostManager/Ghostwriter?label=Code%20Quality)](.)  [![Code Coverage](https://img.shields.io/codecov/c/github/GhostManager/Ghostwriter?label=Code%20Coverage)](.)  [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5139/badge)](https://bestpractices.coreinfrastructure.org/projects/5139) [![Build and Run Unit Test Workflow](https://github.com/GhostManager/Ghostwriter/actions/workflows/workflow.yml/badge.svg)](https://github.com/GhostManager/Ghostwriter/actions/workflows/workflow.yml)

[![Black Hat USA Arsenal 2019 & 2022](https://img.shields.io/badge/2019%20&%202022-Black%20Hat%20USA%20Arsenal-lightgrey.svg)](https://www.blackhat.com/us-19/arsenal/schedule/index.html#ghostwriter-15475) [![Black Hat Asia Arsenal 2022](https://img.shields.io/badge/2022-Black%20Hat%20Asia%20Arsenal-lightgrey.svg)](https://www.blackhat.com/asia-22/arsenal/schedule/index.html#ghostwriter-26252)

![ghostwriter](DOCS/images/logo.png)

Ghostwriter is a Django-based web application designed to be used by an individual or a team of red team operators. The platform tracks and manages client and project information, covert infrastructure assets (e.g., servers and domain names), finding templates, report templates, evidence files, and more.

This data is available to Ghostwriter's reporting engine, which generates complete Word (DOCX) reports using Jinja2 templating and your customized report templates. Ghostwriter can also produce reports in XLSX, PPTX, and JSON formats.

Tap into Ghostwriter's GraphQL API to integrate custom project management, reporting workflows, and external tools into Ghostwriter.

## Details

Check out the introductory blogpost: [Introducing Ghostwriter](https://posts.specterops.io/introducing-ghostwriter-part-1-61e7bd014aff)

This blogpost discusses the design and intent behind Ghostwriter: [Introducing Ghostwriter: Part 2](https://posts.specterops.io/introducing-ghostwriter-part-2-f2d8368a1ed6)

## Documentation

The [Ghostwriter Wiki](https://ghostwriter.wiki/) contains everything you need to know to use or customize Ghostwriter.

The wiki covers everything from installation and setup information for first time users to database schemas, the project's code style guide, and how to expand or customize parts of the project to fit your needs.

## Getting Help

[![Slack Status](https://img.shields.io/badge/Slack-%23ghostwriter-blueviolet?logo=slack)](https://ghst.ly/BHSlack)

The quickest way to get help is Slack. The BloodHound Slack Team has a *#ghostwriter* channel for discussing this project and requesting assistance. There is also a *#reporting* channel for discussing various topics related to writing and managing reports and findings.

You can submit an issue. If you do, please use the issue template and provide as much information as possible.

Before submitting an issue, review the [Ghostwriter Wiki](https://ghostwriter.wiki/). Many of the common issues new users encounter stem from missing an installation step or an issue with Docker on their host system.

## Contributing to the Project

The project team welcomes feedback, new ideas, and external contributions. Please open issues or submit a pull requests! Before submitting a PR, please check open and closed issues for any previous related discussion. Also, the proposed code must follow the [Code Style Guide](https://ghostwriter.wiki/coding-style-guide/style-guide) to be accepted.

We only ask you to limit PR submissions to those that fix a bug, enhance an existing feature, or add something new.

## Contributions

The following people at SpecterOps have contributed much to this project:

* [@covertgeek](https://github.com/covertgeek)
* [@hotnops](https://github.com/hotnops)
* [@andrewchiles](https://github.com/andrewchiles)
* [@ColonelThirtyTwo](https://github.com/ColonelThirtyTwo)

These folks kindly submitted feedback and PRs to fix bugs and enhance existing features. Thank you!

* [@fastlorenzo](https://github.com/fastlorenzo)
* [@mattreduce](https://github.com/mattreduce)
* [@dbuentello](https://github.com/dbuentello)
* [@therealtoastycat](https://github.com/therealtoastycat)
* [@brandonscholet](https://github.com/brandonscholet)
* [@er4z0r](https://github.com/er4z0r)
* [@domwhewell](https://github.com/domwhewell)
* [@KomodoGal](https://github.com/KomodoGal)
* [@federicodotta](https://github.com/federicodotta)

## Supporters

Ghostwriter's continuous development would not be possible without [SpecterOps's](https://www.specterops.io/) commitment to transparency and support for open-source development.

[GitBook](https://www.gitbook.com/) supports this project by hosting the wiki and granting the Ghostwriter team access to their GitBook Community tier as an open-source project.


====================================================================
PyEcore: A Pythonic Implementation of the Eclipse Modeling Framework
====================================================================

|pypi-version| |master-build| |coverage| |code-quality| |license|

.. |master-build| image:: https://travis-ci.org/pyecore/pyecore.svg?branch=master
    :target: https://travis-ci.org/pyecore/pyecore

.. |develop-build| image:: https://travis-ci.org/pyecore/pyecore.svg?branch=develop
    :target: https://travis-ci.org/pyecore/pyecore

.. |pypi-version| image:: https://badge.fury.io/py/pyecore.svg
    :target: https://badge.fury.io/py/pyecore

.. |coverage| image:: https://coveralls.io/repos/github/pyecore/pyecore/badge.svg?branch=master
    :target: https://coveralls.io/github/pyecore/pyecore?branch=master

.. |license| image:: https://img.shields.io/badge/license-New%20BSD-blue.svg
    :target: https://raw.githubusercontent.com/pyecore/pyecore/master/LICENSE

.. |code-quality| image:: https://api.codacy.com/project/badge/Grade/ed038354821f43e7a4579c6a14185cdf
    :target: https://www.codacy.com/app/aranega/pyecore

PyEcore is a Model Driven Engineering (MDE) framework written for Python.
Precisely, it is an implementation of `EMF/Ecore
<https://www.eclipse.org/modeling/emf/>`_ for Python, and it tries to give an
API which is compatible with the original EMF Java implementation.

PyEcore allows you to handle models and metamodels (structured data model), and
gives the key you need for building MDE-based tools and other applications based
on a structured data model. It supports out-of-the-box:

* Data inheritance,
* Two-ways relationship management (opposite references),
* XMI (de)serialization,
* JSON (de)serialization,
* Notification system,
* Reflexive API...

Let's see how we can create a very simple "dynamic" metamodel (as opposed to
static ones, see the `documentation <https://pyecore.readthedocs.io/en/latest/>`_
for more details):

.. code-block:: python

    >>> from pyecore.ecore import EClass, EAttribute, EString, EObject
    >>> Graph = EClass('Graph')  # We create a 'Graph' concept
    >>> Node = EClass('Node')  # We create a 'Node' concept
    >>>
    >>> # We add a "name" attribute to the Graph concept
    >>> Graph.eStructuralFeatures.append(EAttribute('name', EString,
                                                    default_value='new_name'))
    >>> # And one on the 'Node' concept
    >>> Node.eStructuralFeatures.append(EAttribute('name', EString))
    >>>
    >>> # We now introduce a containment relation between Graph and Node
    >>> contains_nodes = EReference('nodes', Node, upper=-1, containment=True)
    >>> Graph.eStructuralFeatures.append(contains_nodes)
    >>> # We add an opposite relation between Graph and Node
    >>> Node.eStructuralFeatures.append(EReference('owned_by', Graph, eOpposite=contains_nodes))

With this code, we have defined two concepts: ``Graph`` and ``Node``. Both have
a ``name``, and there exists a containment relationship between them. This relation
is bi-directional, which means that each time a ``Node`` object is added to the
``nodes`` relationship of a ``Graph``, the ``owned_by`` relation of the ``Node``
is also updated (it also works the other way around).

Let's create some instances of our freshly created metamodel:

.. code-block:: python

    >>> # We create a Graph
    >>> g1 = Graph(name='Graph 1')
    >>> g1
    <pyecore.ecore.Graph at 0x7f0055554dd8>
    >>>
    >>> # And two node instances
    >>> n1 = Node(name='Node 1')
    >>> n2 = Node(name='Node 2')
    >>> n1, n2
    (<pyecore.ecore.Node at 0x7f0055550588>,
     <pyecore.ecore.Node at 0x7f00555502b0>)
    >>>
    >>> # We add them to the Graph
    >>> g1.nodes.extend([n1, n2])
    >>> g1.nodes
    EOrderedSet([<pyecore.ecore.Node object at 0x7f0055550588>,
                 <pyecore.ecore.Node object at 0x7f00555502b0>])
    >>>
    >>> # bi-directional references are updated
    >>> n1.owned_by
    <pyecore.ecore.Graph at 0x7f0055554dd8>

This example gives a quick overview of some of the features you get for free
when using PyEcore.

*The project slowly grows and it still requires more love.*

Installation
============

PyEcore is available on ``pypi``, you can simply install it using ``pip``:

.. code-block:: bash

    $ pip install pyecore

The installation can also be performed manually (better in a virtualenv):

.. code-block:: bash

    $ python setup.py install

Documentation
=============

You can read the documentation at this address:

https://pyecore.readthedocs.io/en/latest/

Dependencies
============

The dependencies required by pyecore are:

* ordered-set which is used for the ``ordered`` and ``unique`` collections expressed in the metamodel,
* lxml which is used for the XMI parsing.

These dependencies are directly installed if you choose to use ``pip``.

Run the Tests
=============

The tests use `py.test` and 'coverage'. Everything is driven by `Tox`, so in order
to run the tests simply run:

.. code-block:: bash

    $ tox

Liberty Regarding the Java EMF Implementation
=============================================

* There is some meta-property that could be missing inside PyEcore. If you see one missing, please open a new ticket!
* Proxies are not "removed" once resolved as in the the Java version, instead they act as transparent proxies and redirect all calls to the 'proxied' object.
* PyEcore is able to automatically load some model/metamodel dependencies on its own.

State
=====

In the current state, the project implements:

* the dynamic/static metamodel definitions,
* reflexive API,
* inheritance,
* enumerations,
* abstract metaclasses,
* runtime typechecking,
* attribute/reference creations,
* collections (attribute/references with upper bound set to ``-1``),
* reference eopposite,
* containment reference,
* introspection,
* select/reject on collections,
* Eclipse XMI import (partially, only single root models),
* Eclipse XMI export (partially, only single root models),
* simple notification/Event system,
* EOperations support,
* code generator for the static part,
* EMF proxies (first version),
* object deletion (first version),
* EMF commands (first version),
* EMF basic command stack,
* EMF very basic Editing Domain,
* JSON import (simple JSON format),
* JSON export (simple JSON format),
* introduce behavior @runtime,
* resources auto-load for some cross-references,
* derived collections,
* multiple roots resources,
* ``xsi:schemaLocation`` support for XMI resources,
* URI mapper like,
* ``EGeneric`` support (first simple version),
* URI converter like

The things that are in the roadmap:

* new implementation of ``EOrderedSet``, ``EList``, ``ESet`` and ``EBag``,
* new implementation of ``EStringToStringMapEntry`` and ``EFeatureMapEntry``,
* improve documentation,
* copy/paste (?).

Existing Projects
=================

There aren't too many projects proposing to handle models and metamodels in Python.
The only projects I found are:

* PyEMOF (http://www.lifl.fr/~marvie/software/pyemof.html)
* EMF4CPP (https://github.com/catedrasaes-umu/emf4cpp)
* PyEMOFUC (http://www.istr.unican.es/pyemofuc/index_En.html)

PyEMOF proposes an implementation of the OMG's EMOF in Python. The project
targets Python2, only supports Class/Primitive Types (no Enumeration), XMI
import/export and does not provide a reflexion layer. The project didn't move
since 2005.

EMF4CPP proposes a C++ implementation of EMF. This implementation also
introduces Python scripts to call the generated C++ code from a Python
environment. It seems that the EMF4CPP does not provide a reflexive layer
either.

PyEMOFUC proposes, like PyEMOF, a pure Python implementation of the OMG's EMOF.
If we stick to a kind of EMF terminology, PyEMOFUC only supports dynamic
metamodels and seems to provide a reflexive layer. The project does not appear
to have moved since a while.

Contributors
============

Thanks for making PyEcore better!

* Mike Pagel (`@moltob <https://github.com/moltob>`_), who is also the author
  of `pyecoregen <https://github.com/pyecore/pyecoregen>`_ and `pymultigen <https://github.com/moltob/pymultigen>`_ (on which pyecoregen is based)
* Terry Kingston (`@TerryKingston <https://github.com/TerryKingston>`_)
* Afonso Pinto (`@afonsobspinto <https://github.com/afonsobspinto>`_)
* Andy (`@CFAndy <https://github.com/CFAndy>`_)
* annighoefer (`@annighoefer <https://github.com/annighoefer>`_)
* Rodriguez Facundo (`@rodriguez-facundo <https://github.com/rodriguez-facundo>`_)
* Filippo Ledda (`@filippometacell <https://github.com/filippometacell>`_)
* Ewoud Werkman (`@ewoudwerkman <https://github.com/ewoudwerkman>`_)
* Eugene (`@4ekin <https://github.com/4ekin>`_)
* Alexandre Acebedo (`@aacebedo <https://github.com/aacebedo>`_)
* Jinhu (`@jinhu <https://github.com/jinhu>`_)
* Pablo Campillo (`@pablo-campillo <https://github.com/pablo-campillo>`_)
* Jose Antonio Moral (`@jamoralp <https://github.com/jamoralp>`_)
* Marco Heinemann (`@ubmarco <https://github.com/ubmarco>`_)
* Christian Drabek (`@cdrabek <https://github.com/cdrabek>`_)
* Dan Yeaw (`@danyeaw <https://github.com/danyeaw>`_)
* Arkadiusz Michał Ryś (`@arrys <https://github.com/arrys>`_)

Additional Resources
====================

* `This article <http://modeling-languages.com/pyecore-python-eclipse-modeling-framework>`_
  on the blog of Professor Jordi Cabot gives more information and
  implementation details about PyEcore.


<!--
SPDX-FileCopyrightText: 2019–2024 Pynguin Contributors

SPDX-License-Identifier: CC-BY-4.0
-->

# Pynguin

Pynguin (IPA: ˈpɪŋɡuiːn),
the
PYthoN
General
UnIt
test
geNerator,
is a tool that allows developers to generate unit tests automatically.

Testing software is often considered to be a tedious task.
Thus, automated generation techniques have been proposed and mature tools exist—for
statically typed languages, such as Java.
There is, however, no fully-automated tool available that produces unit tests for
general-purpose programs in a dynamically typed language.
Pynguin is, to the best of our knowledge, the first tool that fills this gap
and allows the automated generation of unit tests for Python programs.

<details>
<summary>Internal Pipeline Status</summary>

[![pipeline status](https://gitlab.infosun.fim.uni-passau.de/se2/pynguin/pynguin/badges/main/pipeline.svg)](https://gitlab.infosun.fim.uni-passau.de/se2/pynguin/pynguin/-/commits/main)
[![coverage report](https://gitlab.infosun.fim.uni-passau.de/se2/pynguin/pynguin/badges/main/coverage.svg)](https://gitlab.infosun.fim.uni-passau.de/se2/pynguin/pynguin/-/commits/main)

</details>

[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![PyPI version](https://badge.fury.io/py/pynguin.svg)](https://badge.fury.io/py/pynguin)
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/pynguin.svg)](https://github.com/se2p/pynguin)
[![Documentation Status](https://readthedocs.org/projects/pynguin/badge/?version=latest)](https://pynguin.readthedocs.io/en/latest/?badge=latest)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3989840.svg)](https://doi.org/10.5281/zenodo.3989840)
[![REUSE status](https://api.reuse.software/badge/github.com/se2p/pynguin)](https://api.reuse.software/info/github.com/se2p/pynguin)
[![Downloads](https://static.pepy.tech/personalized-badge/pynguin?period=total&units=international_system&left_color=grey&right_color=blue&left_text=Downloads)](https://pepy.tech/project/pynguin)
[![SWH](https://archive.softwareheritage.org/badge/origin/https://github.com/se2p/pynguin/)](https://archive.softwareheritage.org/browse/origin/?origin_url=https://github.com/se2p/pynguin)

![Pynguin Logo](https://raw.githubusercontent.com/se2p/pynguin/master/docs/source/_static/pynguin-logo.png "Pynguin Logo")

## Attention

*Please Note:*

**Pynguin executes the module under test!**
As a consequence, depending on what code is in that module,
running Pynguin can cause serious harm to your computer,
for example, wipe your entire hard disk!
We recommend running Pynguin in an isolated environment;
use, for example, a Docker container to minimize the risk of damaging
your system.

**Pynguin is only a research prototype!**
It is not tailored towards production use whatsoever.
However, we would love to see Pynguin in a production-ready stage at some point;
please report your experiences in using Pynguin to us.

## Prerequisites

Before you begin, ensure you have met the following requirements:
- You have installed Python 3.10 (we have not yet tested with Python
  3.11, there might be some problems due to changed internals regarding the byte-code
  instrumentation).

  **Attention:** Pynguin now requires Python 3.10!  Older versions are no longer
  supported!
- You have a recent Linux/macOS/Windows machine.

Please consider reading the [online documentation](https://pynguin.readthedocs.io)
to start your Pynguin adventure.

## Installing Pynguin

Pynguin can be easily installed using the `pip` tool by typing:
```bash
pip install pynguin
```

Make sure that your version of `pip` is that of a supported Python version, as any
older version is not supported by Pynguin!

## Using Pynguin

Before you continue, please read the [quick start guide](https://pynguin.readthedocs.io/en/latest/user/quickstart.html)

Pynguin is a command-line application.
Once you installed it to a virtual environment, you can invoke the tool by typing
`pynguin` inside this virtual environment.
Pynguin will then print a list of its command-line parameters.

A minimal full command line to invoke Pynguin could be the following,
where we assume that a project `foo` is located in `/tmp/foo`,
we want to store Pynguin's generated tests in `/tmp/testgen`,
and we want to generate tests using a whole-suite approach for the module `foo.bar`
(wrapped for better readability):
```bash
pynguin \
  --project-path /tmp/foo \
  --output-path /tmp/testgen \
  --module-name foo.bar
```
Please find a more detailed example in the [quick start guide](https://pynguin.readthedocs.io/en/latest/user/quickstart.html).

## Contributing to Pynguin

For the development of Pynguin you will need the [`poetry`](https://python-poetry.org)
dependency management and packaging tool.
To start developing, follow these steps:
1. Clone the repository
2. Change to the `pynguin` folder: `cd pynguin`
3. Create a virtual environment and install dependencies using `poetry`: `poetry install`
4. Make your changes
5. Run `make check` to verify that your changes pass all checks

   Please see the [`poetry` documentation](https://python-poetry.org/docs/) for more information on this tool.

## Contributors

Pynguin is developed at the
[Chair of Software Engineering II](https://www.fim.uni-passau.de/lehrstuhl-fuer-software-engineering-ii/)
of the [University of Passau](https://www.uni-passau.de).

Maintainer: [Stephan Lukasczyk](https://github.com/stephanlukasczyk)

Contributors:
- [Juan Altmayer Pizzorno](https://github.com/jaltmayerpizzorno)
- [Lucas Berg](https://github.com/BergLucas)
- [Tucker Blue](https://github.com/tuckcodes)
- [Gordon Fraser](https://github.com/gofraser)
- [Abdur-Rahmaan Janhangeer](https://github.com/Abdur-rahmaanJ)
- [Maximilian Königseder](https://github.com/mak1ng)
- [Florian Kroiß](https://github.com/Wooza)
- [Simon Labrenz](https://github.com/labrenz)
- [Roman Levin](https://github.com/romanlevin)
- [Juan Julián Merelo Guervós](https://github.com/JJ)
- [Lukas Steffens](https://github.com/Luki42)
- [Florian Straubinger](https://github.com/f-str)
- [Sara Tavares](https://github.com/stavares843)

### Development using PyCharm.

If you want to use the PyCharm IDE you have to set up a few things:
1. Import `pynguin` into PyCharm.
2. Let PyCharm configure configure a virtual environment using `poetry`.
3. Set the default test runner to `pytest`
4. Set the DocString format to `Google`

## License

This project is licensed under the terms of the [MIT License](LICENSE.rst).
Pynguin was using the GNU Lesser General Public License (LGPL) until version 0.29.0,
its licence was changed with version 0.30.0.

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=se2p/pynguin&type=Date)](https://star-history.com/#se2p/pynguin)


# PODPAC

[![icon](doc/source/_static/img/icon.svg)](https://podpac.org)

> Pipeline for Observation Data Processing Analysis and Collaboration

[![Build Status](https://travis-ci.org/creare-com/podpac.svg?branch=develop)](https://travis-ci.org/creare-com/podpac)
[![Coverage Status](https://coveralls.io/repos/github/creare-com/podpac/badge.svg)](https://coveralls.io/github/creare-com/podpac)

Data wrangling and processing of geospatial data should be seamless
so that earth scientists can focus on science.

The purpose of PODPAC is to facilitate:

 * Access of data products
 * Subsetting of data products
 * Projecting and interpolating data products
 * Combining/compositing data products
 * Analysis of data products
 * Sharing of algorithms and data products
 * Use of cloud computing architectures (AWS) for processing

## Installation

For installation instructions, see [install.md](doc/source/install.md).

## Documentation

The official PODPAC documentation is available here: [https://podpac.org](https://podpac.org)

For usage examples, see the [podpac-examples](https://github.com/creare-com/podpac_examples) repository.

## Contributing

You can find more information on contributing to PODPAC on the [Contributing page](https://podpac.org/contributing.html)

## Stability / Maturity

PODPAC is in a *beta* phase of development. As such:

* All development will adhere to a semantic versioning system
* Major revisions may contain backwards incompatible changes, but these changes will be documented in the [CHANGELOG](CHANGELOG.md)
* We are working to improve documentation, please contact us or create an issue if documentation is out of date or incorrect
* We look forward to receive feedback on usability and compatibility

## Acknowledgments

This material is based upon work supported by NASA under Contract No 80NSSC18C0061.

## References

For PODPAC references, see the [References page](https://podpac.org/references.html)


stestr
======

.. image:: https://github.com/mtreinish/stestr/actions/workflows/main.yml/badge.svg?branch=main
    :target: https://github.com/mtreinish/stestr/actions/workflows/main.yml
    :alt: CI Testing status

.. image:: https://img.shields.io/codecov/c/gh/mtreinish/stestr?style=flat-square
    :target: https://codecov.io/gh/mtreinish/stestr
    :alt: Code coverage

.. image:: https://img.shields.io/pypi/v/stestr.svg?style=flat-square
    :target: https://pypi.python.org/pypi/stestr
    :alt: Latest Version

.. image:: https://img.shields.io/github/license/mtreinish/stestr.svg?style=popout-square
    :target: https://opensource.org/licenses/Apache-2.0
    :alt: License:

* Read this in other languages: `English`_, `日本語`_
* You can see the full rendered docs at: http://stestr.readthedocs.io/en/latest/
* The code of the project is on Github: https://github.com/mtreinish/stestr

.. _English: https://github.com/mtreinish/stestr/blob/main/README.rst
.. _日本語: https://github.com/mtreinish/stestr/blob/main/README_ja.rst

.. note:: stestr v2.x.x release series will be the last series that supports
    Python 2. Support for Python 2.7 was dropped in stestr release 3.0.0.

Overview
--------

stestr is parallel Python test runner designed to execute `unittest`_ test
suites using multiple processes to split up execution of a test suite. It also
will store a history of all test runs to help in debugging failures and
optimizing the scheduler to improve speed. To accomplish this goal it uses the
`subunit`_ protocol to facilitate streaming and storing results from multiple
workers.

.. _unittest: https://docs.python.org/3/library/unittest.html
.. _subunit: https://github.com/testing-cabal/subunit

stestr originally started as a fork of the `testrepository`_ project. But,
instead of being an interface for any test runner that used subunit, like
testrepository, stestr concentrated on being a dedicated test runner for python
projects. While stestr was originally forked from testrepository it is not
backwards compatible with testrepository. At a high level the basic concepts of
operation are shared between the two projects but the actual usage is not
exactly the same.

.. _testrepository: https://testrepository.readthedocs.org/en/latest

Installing stestr
-----------------

stestr is available via pypi, so all you need to do is run::

  pip install -U stestr

to get stestr on your system. If you need to use a development version of
stestr you can clone the repo and install it locally with::

  git clone https://github.com/mtreinish/stestr.git && pip install -e stestr

which will install stestr in your python environment in editable mode for local
development

Using stestr
------------

After you install stestr to use it to run tests is pretty straightforward. The
first thing you'll want to do is create a ``.stestr.conf`` file for your
project. This file is used to tell stestr where to find tests and basic
information about how tests are run. A basic minimal example of the
contents of this is::

  [DEFAULT]
  test_path=./project_source_dir/tests

which just tells stestr the relative path for the directory to use for
test discovery. This is the same as ``--start-directory`` in the standard
`unittest discovery`_.

.. _unittest discovery: https://docs.python.org/3/library/unittest.html#test-discovery

Alternatively, if you're using stestr with
`tox <https://tox.readthedocs.io/en/latest/>`__ you can integrate your stestr
config in a ``stestr`` section in the tox.ini file, for example::

  [stestr]
  test_path=./project_source_dir/tests

After stestr is configured you should be all set to start using stestr
to run tests. To run tests just use::

    stestr run

it will first create a results repository at ``.stestr/`` in the current
working directory and then execute all the tests found by test discovery. If
you're just running a single test (or module) and want to avoid the overhead of
doing test discovery you can use the ``--no-discover``/``-n`` option to specify
that test.

For all the details on these commands and more thorough explanation of options
see the stestr manual: https://stestr.readthedocs.io/en/latest/MANUAL.html

Migrating from testrepository
-----------------------------

If you have a project that is already using testrepository stestr's source repo
contains a helper script for migrating your repo to use stestr. This script
just creates a ``.stestr.conf`` file from a ``.testr.conf`` file.
(assuming it uses a standard subunit.run test command format) To run
this from your project repo just call::

    $STESTR_SOURCE_DIR/tools/testr_to_stestr.py

and you'll have a ``.stestr.conf`` created.

Building a manpage
------------------

The stestr manual has been formatted so that it renders well as html and as a
manpage. The html output and is autogenerated and published to:
https://stestr.readthedocs.io/en/latest/MANUAL.html but the manpage has to be
generated by hand. To do this you have to manually run sphinx-build with the
manpage builder. This has been automated in a small script that should be run
from the root of the stestr repository::

  tools/build_manpage.sh

which will generate the troff file in doc/build/man/stestr.1 which is ready to
be packaged and or put in your system's man pages.

Contributing
------------

To browse the latest code, see: https://github.com/mtreinish/stestr
To clone the latest code, use: ``git clone https://github.com/mtreinish/stestr.git``

Guidelines for contribution are documented at: http://stestr.readthedocs.io/en/latest/developer_guidelines.html

Use `github pull requests`_ to submit patches. Before you submit a pull request
ensure that all the automated testing will pass by running ``tox`` locally.
This will run the test suite and also the automated style rule checks just as
they will in CI. If CI fails on your change it will not be able to merge.

.. _github pull requests: https://help.github.com/articles/about-pull-requests/

Community
---------

Besides Github interactions there is also a stestr IRC channel:

#stestr on `OFTC <https://oftc.net/>`__

feel free to join to ask questions, or just discuss stestr.


============
ThriftPy2
============

.. image:: https://img.shields.io/codecov/c/github/Thriftpy/thriftpy2.svg
    :target: https://codecov.io/gh/Thriftpy/thriftpy2

.. image:: https://img.shields.io/pypi/dm/thriftpy2.svg
    :target: https://pypi.org/project/thriftpy2/

.. image:: https://img.shields.io/pypi/v/thriftpy2.svg
    :target: https://pypi.org/project/thriftpy2/

.. image:: https://img.shields.io/pypi/pyversions/thriftpy2.svg
    :target: https://pypi.org/project/thriftpy2/

.. image:: https://img.shields.io/pypi/implementation/thriftpy2.svg
    :target: https://pypi.org/project/thriftpy2/

ThriftPy: https://github.com/eleme/thriftpy has been deprecated, ThriftPy2 aims to provide long term support.

Migrate from Thriftpy?
======================

All you need is:

.. code:: python

    import thriftpy2 as thriftpy

That's it! thriftpy2 is fully compatible with thriftpy.

Installation
============

Install with pip.

.. code:: bash

    $ pip install thriftpy2

You may also install cython first to build cython extension locally.

.. code:: bash

    $ pip install cython thriftpy2

Code Demo
=========

ThriftPy make it super easy to write server/client code with thrift. Let's
checkout this simple pingpong service demo.

We need a 'pingpong.thrift' file:

::

    service PingPong {
        string ping(),
    }

Then we can make a server:

.. code:: python

    import thriftpy2
    pingpong_thrift = thriftpy2.load("pingpong.thrift", module_name="pingpong_thrift")

    from thriftpy2.rpc import make_server

    class Dispatcher(object):
        def ping(self):
            return "pong"

    server = make_server(pingpong_thrift.PingPong, Dispatcher(), '127.0.0.1', 6000)
    server.serve()

And a client:

.. code:: python

    import thriftpy2
    pingpong_thrift = thriftpy2.load("pingpong.thrift", module_name="pingpong_thrift")

    from thriftpy2.rpc import make_client

    client = make_client(pingpong_thrift.PingPong, '127.0.0.1', 6000)
    print(client.ping())

And it also supports asyncio on Python 3.5 or later:

.. code:: python

    import thriftpy2
    import asyncio
    from thriftpy2.rpc import make_aio_client

    echo_thrift = thriftpy2.load("echo.thrift", module_name="echo_thrift")

    async def request():
        client = await make_aio_client(
            echo_thrift.EchoService, '127.0.0.1', 6000)
        print(await client.echo('hello, world'))
        client.close()

.. code:: python

    import asyncio
    import thriftpy2

    from thriftpy2.rpc import make_aio_server

    echo_thrift = thriftpy2.load("echo.thrift", module_name="echo_thrift")

    class Dispatcher(object):
        async def echo(self, param):
            print(param)
            await asyncio.sleep(0.1)
            return param

    def main():
        server = make_aio_server(
            echo_thrift.EchoService, Dispatcher(), '127.0.0.1', 6000)
        server.serve()

    if __name__ == '__main__':
        main()

See, it's that easy!

You can refer to 'examples' and 'tests' directory in source code for more
usage examples.

Features
========

Currently ThriftPy have these features (also advantages over the upstream
python lib):

- Python 3.6+ and PyPy3.

- Pure python implementation. No longer need to compile & install the 'thrift'
  package. All you need is thriftpy2 and thrift file.

- Compatible with Apache Thrift. You can use ThriftPy together with the
  official implementation servers and clients, such as a upstream server with
  a thriftpy2 client or the opposite.

  Currently implemented protocols and transports:

  * binary protocol (python and cython)

  * compact protocol (python and cython)

  * json protocol

  * Apache JSON protocol compatible with apache thrift distribution's JSON protocol.
    Simply do ``from thriftpy2.protocol import TApacheJSONProtocolFactory`` and pass
    this to the ``proto_factory`` argument where appropriate.

  * buffered transport (python & cython)

  * framed transport

  * tornado server and client (with tornado 4.0)

  * http server and client

  * asyncio support (python 3.5 or later)

- Can directly load thrift file as module, the sdk code will be generated on
  the fly.

  For example, ``pingpong_thrift = thriftpy2.load("pingpong.thrift", module_name="pingpong_thrift")``
  will load 'pingpong.thrift' as 'pingpong_thrift' module.

  Or, when import hook enabled by ``thriftpy2.install_import_hook()``, you can
  directly use ``import pingpong_thrift`` to import the 'pingpong.thrift' file
  as module, you may also use ``from pingpong_thrift import PingService`` to
  import specific object from the thrift module.

- Easy RPC server/client setup.

Contribute
==========

1. Fork the repo and make changes.

2. Write a test which shows a bug was fixed or the feature works as expected.

3. Make sure ``tox`` tests succeed.

4. Send pull request.

Contributors
============

https://github.com/Thriftpy/thriftpy2/graphs/contributors

Sponsors:
============

.. image:: ./docs/jetbrains.svg
    :target: https://www.jetbrains.com/?from=ThriftPy

Changelog
=========

https://github.com/Thriftpy/thriftpy2/blob/master/CHANGES.rst


[![ci](https://img.shields.io/github/actions/workflow/status/pyamg/pyamg/ci.yml?style=flat-square&label=tests)](https://github.com/pyamg/pyamg/actions?query=workflow%3ACI-test+branch%3Amain)
[![lint](https://img.shields.io/github/actions/workflow/status/pyamg/pyamg/lint.yml?style=flat-square&label=lint)](https://github.com/pyamg/pyamg/actions?query=workflow%3ACI-lint+branch%3Amain)
[![PyPI - Version](https://img.shields.io/pypi/v/pyamg?style=flat-square)](https://pypi.org/project/pyamg/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyamg?style=flat-square)](https://pypi.org/project/pyamg/)
[![Codecov](https://img.shields.io/codecov/c/github/pyamg/pyamg?style=flat-square)](https://app.codecov.io/gh/pyamg/pyamg)
[![joss](https://joss.theoj.org/papers/10.21105/joss.05495/status.svg?style=flat-square)](https://doi.org/10.21105/joss.05495)

# Installation
PyAMG requires `numpy` and `scipy`

```
pip install pyamg
```

or from source:

```
pip install .
```

(`python setup.py install` will no longer work)

or with conda (see details below)

```
conda config --add channels conda-forge
conda install pyamg
```

# Introduction

PyAMG is a library of **Algebraic Multigrid (AMG)** solvers with a convenient Python interface.

![](https://raw.githubusercontent.com/pyamg/pyamg/main/docs/logo/pyamg_logo_withtext.png)

PyAMG is currently developed and maintained by
[Luke Olson](http://lukeo.cs.illinois.edu),
[Jacob Schroder](https://www.unm.edu/~jbschroder), and
[Ben Southworth](https://arxiv.org/a/southworth_b_1.html).
The organization of the project can be found in [`organization.md`](organization.md) and
examples of use can be found in [`pyamg-examples`](https://github.com/pyamg/pyamg-examples).

**Acknowledgements:**
PyAMG was created by
[Nathan Bell](http://wnbell.com/),
[Luke Olson](http://lukeo.cs.illinois.edu), and
[Jacob Schroder](https://www.unm.edu/~jbschroder).
Portions of the project were partially supported by the NSF under award DMS-0612448.

# Citing

If you use PyAMG in your work, please consider using the following citation:

@article{pyamg2023,
  author    = {Nathan Bell and Luke N. Olson and Jacob Schroder and Ben Southworth},
  title     = {{PyAMG}: Algebraic Multigrid Solvers in Python},
  journal   = {Journal of Open Source Software},
  year      = {2023},
  publisher = {The Open Journal},
  volume    = {8},
  number    = {87},
  pages     = {5495},
  doi       = {10.21105/joss.05495},
  url       = {https://doi.org/10.21105/joss.05495},
}

# Getting Help

- For documentation see [http://pyamg.readthedocs.io/en/latest/](http://pyamg.readthedocs.io/en/latest/).

- Create an [issue](https://github.com/pyamg/pyamg/issues).

- Look at the [Tutorial](https://github.com/pyamg/pyamg/wiki/Tutorial) or the [examples](https://github.com/pyamg/pyamg-examples) (for instance  the [0_start_here](https://github.com/pyamg/pyamg-examples/blob/main/0_start_here/demo.py) example).

- Run the unit tests (`pip install pytest`):
  - With PyAMG installed and from a non-source directory:
  ```python
  import pyamg
  pyamg.test()
  ```
  - From the PyAMG source directory and installed (e.g. with `pip install -e .`):
  ```python
  pytest .
  ```

# What is AMG?

 AMG is a multilevel technique for solving large-scale linear systems with optimal or near-optimal efficiency.  Unlike geometric multigrid, AMG requires little or no geometric information about the underlying problem and develops a sequence of coarser grids directly from the input matrix.  This feature is especially important for problems discretized on unstructured meshes and irregular grids.

# PyAMG Features

PyAMG features implementations of:

- **Ruge-Stuben (RS)** or *Classical AMG*
- AMG based on **Smoothed Aggregation (SA)**

and experimental support for:

- **Adaptive Smoothed Aggregation (αSA)**
- **Compatible Relaxation (CR)**

The predominant portion of PyAMG is written in Python with a smaller amount of supporting C++ code for performance critical operations.

# Example Usage

PyAMG is easy to use!  The following code constructs a two-dimensional Poisson problem and solves the resulting linear system with Classical AMG.

````python
import pyamg
import numpy as np
A = pyamg.gallery.poisson((500,500), format='csr')  # 2D Poisson problem on 500x500 grid
ml = pyamg.ruge_stuben_solver(A)                    # construct the multigrid hierarchy
print(ml)                                           # print hierarchy information
b = np.random.rand(A.shape[0])                      # pick a random right hand side
x = ml.solve(b, tol=1e-10)                          # solve Ax=b to a tolerance of 1e-10
print("residual: ", np.linalg.norm(b-A*x))          # compute norm of residual vector
````

Program output:

multilevel_solver
Number of Levels:     9
Operator Complexity:  2.199
Grid Complexity:      1.667
Coarse Solver:        'pinv2'
  level   unknowns     nonzeros
    0       250000      1248000 [45.47%]
    1       125000      1121002 [40.84%]
    2        31252       280662 [10.23%]
    3         7825        70657 [ 2.57%]
    4         1937        17971 [ 0.65%]
    5          483         4725 [ 0.17%]
    6          124         1352 [ 0.05%]
    7           29          293 [ 0.01%]
    8            7           41 [ 0.00%]

residual:  1.24748994988e-08

# Conda

More information can be found at [conda-forge/pyamg-feedstock](https://github.com/conda-forge/pyamg-feedstock).

*Linux:*
[![Circle CI](https://circleci.com/gh/conda-forge/pyamg-feedstock.svg?style=shield)](https://circleci.com/gh/conda-forge/pyamg-feedstock)

*OSX:*
[![TravisCI](https://travis-ci.org/conda-forge/pyamg-feedstock.svg?branch=master)](https://travis-ci.org/conda-forge/pyamg-feedstock)

*Windows:*
[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/conda-forge/pyamg-feedstock?svg=True)](https://ci.appveyor.com/project/conda-forge/pyamg-feedstock/branch/master)

*Version:*
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/pyamg/badges/version.svg)](https://anaconda.org/conda-forge/pyamg)

*Downloads:*
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/pyamg/badges/downloads.svg)](https://anaconda.org/conda-forge/pyamg)

Installing `pyamg` from the `conda-forge` channel can be achieved by adding `conda-forge` to your channels with:

```
conda config --add channels conda-forge
```

Once the `conda-forge` channel has been enabled, `pyamg` can be installed with:

```
conda install pyamg
```

It is possible to list all of the versions of `pyamg` available on your platform with:

```
conda search pyamg --channel conda-forge
```


# README #

wradlib is designed to assist you in the most important steps of
processing weather radar data. These may include: reading common data
formats, georeferencing, converting reflectivity to rainfall
intensity, identifying and correcting typical error sources (such as
clutter or attenuation) and visualising the data.

[![Join the chat at https://gitter.im/wradlib/wradlib](https://badges.gitter.im/wradlib/wradlib.svg)](https://gitter.im/wradlib/wradlib?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

**To anyone who wants to use a bleeding edge version of wradlib from this repository:**

wradlib uses GitHub Actions for Continuous Integration. This means that once new code is pushed to the wradlib repository, a suite of tests and checks are run. In case the tests run without failure, a new documentation will be built on readthedocs and is available at the [wradlib documentation website](https://docs.wradlib.org).

Below you see the status of wradlib. A green status indicates that the current revision of wradlib did pass the tests successfully. You should be aware of that a green status is not a guarantee that the latest revision is bug free. It just means that our tests did not find any bugs. Also, the status of code coverage, of ReadTheDocs documentation builds and of availability of wradlib conda package is displayed.

## Package Status ##

| Item | Status |
| --- | --- |
| Github Latest | [![Build Status](https://github.com/wradlib/wradlib/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/wradlib/wradlib/actions/workflows/ci.yml) |
| Github Release | [![Build Status](https://github.com/wradlib/wradlib/actions/workflows/ci.yml/badge.svg?event=release)](https://github.com/wradlib/wradlib/actions/workflows/ci.yml) |
| Codecov | [![codecov](https://codecov.io/gh/wradlib/wradlib/branch/main/graph/badge.svg)](https://codecov.io/gh/wradlib/wradlib) |
| RTD Latest | [![ReadTheDocs Latest](https://readthedocs.org/projects/wradlib/badge/?version=latest)](https://docs.wradlib.org/en/latest/) |
| RTD Stable | [![ReadTheDocs Stable](https://readthedocs.org/projects/wradlib/badge/?version=stable)](https://docs.wradlib.org/en/stable/) |
| Anaconda Latest | [![Anaconda Latest](https://anaconda.org/conda-forge/wradlib/badges/latest_release_date.svg)](https://anaconda.org/conda-forge/wradlib/) |
| Anaconda Version | [![Anaconda Status](https://anaconda.org/conda-forge/wradlib/badges/version.svg)](https://anaconda.org/conda-forge/wradlib/) |

### Documentation ###

For further information on wradlib (getting started, library reference, development setup, ...), please see our homepage:

https://wradlib.org

Specific information for developers is available via the [wradlib-wiki](https://github.com/wradlib/wradlib/wiki).

### Citing wradlib

You can cite wradlib using the DOI below, or select the fitting zenodo DOI if you want to cite a distinct wradlib version by following the link.

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1209843.svg)](https://doi.org/10.5281/zenodo.1209843)

### User forum ###

In order to stay tuned, we recommend that you register to the [openradar discourse](https://openradar.discourse.group).

### Found any bugs or want to add wishes ###

Create an issue [here](https://github.com/wradlib/wradlib/issues).


[![CircleCI](https://circleci.com/gh/bioconda/bioconda-utils/tree/master.svg?style=shield)](https://circleci.com/gh/bioconda/bioconda-utils/tree/master)
[![Gitter](https://badges.gitter.im/bioconda/bioconda-recipes.svg)](https://gitter.im/bioconda/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

![](https://raw.githubusercontent.com/bioconda/bioconda-recipes/master/logo/bioconda_monochrome_small.png
 "Bioconda")

`bioconda-utils` is a set of utilities for building and managing
[bioconda](https://github.com/bioconda/bioconda-recipes) recipes.

Since `bioconda-utils` is tightly coupled to `bioconda-recipes`, it is
strongly recommended that `bioconda-utils` be set up and used according to the
instructions at https://bioconda.github.io/contributor/index.html. This will
ensure that your local setup matches that used to build recipes on travis-ci as
closely as possible.

However, if you would like to test in a standalone manner or help develop
bioconda-utils, you can install requirements via conda into your root conda
environment and then install the package:

```bash
conda install --file bioconda_utils/bioconda_utils-requirements.txt -c conda-forge -c bioconda
python setup.py install
```

See the help for the `bioconda-utils` command-line interface for details:

```bash
bioconda-utils -h
```


---
layout:		readme
title:		"Home"
---

![logo-fire-red](https://github.com/SuadeLabs/fire/assets/12458414/9aa87ab9-6fbd-4f1f-8e2f-146dddf92229)

# Financial Regulatory (FIRE) Data Standard

---
![Build Status](https://github.com/SuadeLabs/fire/actions/workflows/ci-pipeline.yml/badge.svg)
[![Project Website](https://img.shields.io/badge/website-fire-red.svg)][fire]
[![Apache 2.0 License](https://img.shields.io/badge/LICENSE-Apache_2.0-yellow.svg)][license]
[![Join the chat at https://gitter.im/SuadeLabs/fire](https://badges.gitter.im/SuadeLabs/fire.svg)][gitter]
[![Contributor Guidelines](https://img.shields.io/badge/contributor-guidelines-lightgrey.svg)][contributing]

### What is the FIRE data standard?
The Financial Regulatory Data Standard (FIRE) defines a common specification for the transmission of granular data between regulatory systems in finance. Regulatory data refers to the data that underlies regulatory submissions, requirements, calculations and is used for policy, monitoring and supervision purposes.

The FIRE data schemas and code samples are licensed under the [Apache 2.0 License][apache] which has been chosen for being open, permissive and already widely accepted within the financial sector (think Hadoop, Cassandra, ActiveMQ).

The FIRE data standard is supported by the [European Commission][euc], the [Open Data Institute][odi] and the [Open Data Incubator for Europe][odine] via the Horizon 2020 funding programme.

---

Please see the [contributing guidelines][contributing] and [guiding principles][guiding-principles] if you would like to contribute to this project.

### Random FIRE Data Generator
Included is a [random data generator][random-fire] which will generate data in line with the FIRE schema, but not necessarily realistic. (eg. You might get a loan with a balance of 10 but accrued interest of 1 million)

### Testing
You can run tests locally via `./run_tests.sh` or view the [CI test results here][travis-ci]

---
[fire]:         https://suade.org/fire/
[license]:      https://github.com/SuadeLabs/fire/blob/master/LICENSE
[gitter]:       https://gitter.im/SuadeLabs/fire
[contributing]: https://github.com/SuadeLabs/fire/blob/master/CONTRIBUTING.md
[guiding-principles]: https://github.com/SuadeLabs/fire/blob/master/guiding_principles.md
[apache]:	http://www.apache.org/licenses/LICENSE-2.0
[euc]:		http://ec.europa.eu/index_en.htm
[odi]:		http://opendata.institute/
[odine]:	https://opendataincubator.eu/
[random-fire]:      https://github.com/SuadeLabs/fire/blob/master/random_fire_generator.py
[travis-ci]:        https://travis-ci.org/github/SuadeLabs/fire


[![PyPI version](https://badge.fury.io/py/typhon.svg)](https://badge.fury.io/py/typhon)
[![Anaconda-Server Badge](https://anaconda.org/rttools/typhon/badges/installer/conda.svg)](https://anaconda.org/rttools/typhon)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1300318.svg)](https://doi.org/10.5281/zenodo.1300318)
[![Test](https://github.com/atmtools/typhon/workflows/Test/badge.svg?branch=master)](https://github.com/atmtools/typhon/commits/master)

# typhon - Tools for atmospheric research

## Installation
Typhon requires Python version 3.10 or higher. The recommended way to get Python
is through [Miniforge3]. But of course, any other Python distribution is also
working.

### Stable release
The latest stable release of typhon can be installed using ``conda``
(recommended)
```bash
$ conda install -c rttools typhon
```
or ``pip``
```bash
$ pip install typhon
```

### Development version
Check our information on how to [setup a development environment](CONDA-ENV.md)
for typhon.

## Testing
Typhon contains a simple testing framework using [pytest]. It is good
practice to write tests for all your functions and classes. Those tests may not
be too extensive but should cover the basic use cases to ensure correct
behavior through further development of the package.

Tests can be run on the command line...
```bash
$ pytest --pyargs typhon
```
or using the Python interpreter:
```python
import typhon
typhon.test()
```

## Configuration
Typhon supports a configuration file in ``configparser`` syntax. The
configuration is handled by the ``typhon.config`` module. The default file
location is ``~/.typhonrc`` but can be changed using the ``TYPHONRC``
environment variable.

## Documentation
A recent build of the documentation is accessible
[online](http://radiativetransfer.org/misc/typhon/doc-trunk).
Kindly note that bleeding edge features might not be covered.

[Sphinx]: http://www.sphinx-doc.org
[Miniforge3]: https://github.com/conda-forge/miniforge#miniforge
[pytest]: https://docs.pytest.org/