emhub


Nameemhub JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/3dem/emhub
SummaryWeb application for monitoring EM results
upload_time2024-10-04 17:58:46
maintainerNone
docs_urlNone
authorJ.M. De la Rosa Trevin, Grigory Sharov
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
.. |logo_image| image:: https://github.com/3dem/emhub/wiki/images/emhub.png
   :height: 60px

.. |logo_text| image:: https://github.com/3dem/emhub/wiki/images/emhub-default-logo.svg
   :height: 60px

|logo_image| |logo_text|

EMhub is a web application for data management at scientific core facilities, specially 
designed for operations of middle-size CryoEM centers. It allows the creation of users and 
resources (e.g. microscopes or other instruments). It also coordinates access to resources through
applications and bookings, providing full traceability and reporting of usage. 

Additionally, a REST API is exposed that permits the writing of external scripts to communicate with the
application. This feature allows to write "workers" that can monitor new data collection
sessions and handle different tasks such as data transfer or on-the-fly processing.

For more detailed information check the documentation at:

https://3dem.github.io/emdocs/emhub/


Development
===========

Basic Installation
------------------

.. code-block:: bash

    conda create --name=emhub python=3.8
    conda activate emhub

    git clone https://github.com/3dem/emhub.git
    # OR
    git clone git@github.com:3dem/emhub.git
    cd emhub

    # If you want to use the development branch, then do:
    # git checkout devel

    pip install -e .

    # Generate some test data
    emh-data --create_instance

    export FLASK_APP=emhub
    export EMHUB_INSTANCE=~/.emhub/instances/test

    # Now launch the built-in Flask development server:
    flask run --debug

    # or with gunicorn:
    gunicorn -k gevent --workers=2 'emhub:create_app()' --bind 0.0.0.0:5000

    # Then launch a web browser at http://127.0.0.1:5000/
    # user: admin, password: admin


Publishing the package to PyPI
------------------------------

In order to make the emhub available to install with `pip install emhub`,
we need to:

.. code-block:: bash

    python install twine restructuredtext-lint
    cd emhub

    # It might be a good idea to check the README.rst before uploading:
    rst-lint README.rst

    python setup.py sdist
    twine upload dist/emhub-0.0.1a3.tar.gz


Creating a Docker image
-----------------------

A Dockerfile has been include to create Docker images.

.. code-block:: bash

    cd emhub
    docker build . -t emhub
    docker run --rm -p 8080:8080 --name=emhub -v $PWD/instance:/instance


Upgrading Database model with Alembic
-------------------------------------

If we modify the database models, then an update/migration is required.

.. code-block:: bash

    # Do changes in the model (data_models.py)

    alembic revision --autogenerate

    # Review the generated script

    alembic upgrade head  # or use first the --sql option to see the commands


Generating Documentation with Sphinx
------------------------------------
A Python environment with Sphinx and other dependencies is required
to build the documentation.

.. code-block:: bash

    # Install environment

    conda create -y --name=emhub-docs python=3.8
    conda activate emhub-docs
    conda install nodejs=20 -c conda-forge -y
    npm install -g jsdoc
    pip install -e .  # install emhub
    pip install -r docs/requirements.txt  # install doc requirements

    # Build the docs

    python build_docs.py

    # or just
    sphinx-build -b html docs/ html/

    # Rsync the generated html files to the emdocs repo

    rsync -av html/ ~/work/documentation/emdocs/emhub/
    cd ../emhub-docs/
    git ci -am "Updated html files"



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/3dem/emhub",
    "name": "emhub",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "J.M. De la Rosa Trevin, Grigory Sharov",
    "author_email": "delarosatrevin@scilifelab.se, gsharov@mrc-lmb.cam.ac.uk",
    "download_url": "https://files.pythonhosted.org/packages/ad/fd/bec222f9196a1b7a36ecbbb5825e7ade1b9df2349d2691a6bbe7bea8b02b/emhub-1.0.2.tar.gz",
    "platform": null,
    "description": "\n.. |logo_image| image:: https://github.com/3dem/emhub/wiki/images/emhub.png\n   :height: 60px\n\n.. |logo_text| image:: https://github.com/3dem/emhub/wiki/images/emhub-default-logo.svg\n   :height: 60px\n\n|logo_image| |logo_text|\n\nEMhub is a web application for data management at scientific core facilities, specially \ndesigned for operations of middle-size CryoEM centers. It allows the creation of users and \nresources (e.g. microscopes or other instruments). It also coordinates access to resources through\napplications and bookings, providing full traceability and reporting of usage. \n\nAdditionally, a REST API is exposed that permits the writing of external scripts to communicate with the\napplication. This feature allows to write \"workers\" that can monitor new data collection\nsessions and handle different tasks such as data transfer or on-the-fly processing.\n\nFor more detailed information check the documentation at:\n\nhttps://3dem.github.io/emdocs/emhub/\n\n\nDevelopment\n===========\n\nBasic Installation\n------------------\n\n.. code-block:: bash\n\n    conda create --name=emhub python=3.8\n    conda activate emhub\n\n    git clone https://github.com/3dem/emhub.git\n    # OR\n    git clone git@github.com:3dem/emhub.git\n    cd emhub\n\n    # If you want to use the development branch, then do:\n    # git checkout devel\n\n    pip install -e .\n\n    # Generate some test data\n    emh-data --create_instance\n\n    export FLASK_APP=emhub\n    export EMHUB_INSTANCE=~/.emhub/instances/test\n\n    # Now launch the built-in Flask development server:\n    flask run --debug\n\n    # or with gunicorn:\n    gunicorn -k gevent --workers=2 'emhub:create_app()' --bind 0.0.0.0:5000\n\n    # Then launch a web browser at http://127.0.0.1:5000/\n    # user: admin, password: admin\n\n\nPublishing the package to PyPI\n------------------------------\n\nIn order to make the emhub available to install with `pip install emhub`,\nwe need to:\n\n.. code-block:: bash\n\n    python install twine restructuredtext-lint\n    cd emhub\n\n    # It might be a good idea to check the README.rst before uploading:\n    rst-lint README.rst\n\n    python setup.py sdist\n    twine upload dist/emhub-0.0.1a3.tar.gz\n\n\nCreating a Docker image\n-----------------------\n\nA Dockerfile has been include to create Docker images.\n\n.. code-block:: bash\n\n    cd emhub\n    docker build . -t emhub\n    docker run --rm -p 8080:8080 --name=emhub -v $PWD/instance:/instance\n\n\nUpgrading Database model with Alembic\n-------------------------------------\n\nIf we modify the database models, then an update/migration is required.\n\n.. code-block:: bash\n\n    # Do changes in the model (data_models.py)\n\n    alembic revision --autogenerate\n\n    # Review the generated script\n\n    alembic upgrade head  # or use first the --sql option to see the commands\n\n\nGenerating Documentation with Sphinx\n------------------------------------\nA Python environment with Sphinx and other dependencies is required\nto build the documentation.\n\n.. code-block:: bash\n\n    # Install environment\n\n    conda create -y --name=emhub-docs python=3.8\n    conda activate emhub-docs\n    conda install nodejs=20 -c conda-forge -y\n    npm install -g jsdoc\n    pip install -e .  # install emhub\n    pip install -r docs/requirements.txt  # install doc requirements\n\n    # Build the docs\n\n    python build_docs.py\n\n    # or just\n    sphinx-build -b html docs/ html/\n\n    # Rsync the generated html files to the emdocs repo\n\n    rsync -av html/ ~/work/documentation/emdocs/emhub/\n    cd ../emhub-docs/\n    git ci -am \"Updated html files\"\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Web application for monitoring EM results",
    "version": "1.0.2",
    "project_urls": {
        "Bug Reports": "https://github.com/3dem/emhub/issues",
        "Homepage": "https://github.com/3dem/emhub",
        "Source": "https://github.com/3dem/emhub/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "adfdbec222f9196a1b7a36ecbbb5825e7ade1b9df2349d2691a6bbe7bea8b02b",
                "md5": "40ec94e40dec88fa049eddf37068ecd1",
                "sha256": "1d15a2dcc1f5d579d3fa2b2a10b92a6218fba9ce8112a67f3d94ec61d065ef25"
            },
            "downloads": -1,
            "filename": "emhub-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "40ec94e40dec88fa049eddf37068ecd1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6629765,
            "upload_time": "2024-10-04T17:58:46",
            "upload_time_iso_8601": "2024-10-04T17:58:46.891422Z",
            "url": "https://files.pythonhosted.org/packages/ad/fd/bec222f9196a1b7a36ecbbb5825e7ade1b9df2349d2691a6bbe7bea8b02b/emhub-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-04 17:58:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "3dem",
    "github_project": "emhub",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "emhub"
}
        
Elapsed time: 1.10905s