### Install Testing Tools Source: https://github.com/zepmanbc/creopyson/blob/master/CONTRIBUTING.rst Install flake8 and tox if they are not already installed. ```shell pipenv install -r requirements-dev.txt --dev ``` -------------------------------- ### Install Creopyson from Source Source: https://github.com/zepmanbc/creopyson/blob/master/docs/installation.md After obtaining the source code (either by cloning or downloading), use this command to install Creopyson. This requires Python and setuptools to be installed. ```console python setup.py install ``` -------------------------------- ### Install Dependencies with Pipenv Source: https://github.com/zepmanbc/creopyson/blob/master/docs/contributing.md Install creopyson and development dependencies using pipenv after cloning the repository. ```shell $ cd creopyson/ $ pipenv install --dev ``` -------------------------------- ### Install Development Dependencies Source: https://github.com/zepmanbc/creopyson/blob/master/CONTRIBUTING.rst Install Creopyson and its development dependencies using pipenv. ```shell cd creopyson/ pipenv install --dev ``` -------------------------------- ### Import Creopyson Library Source: https://github.com/zepmanbc/creopyson/blob/master/docs/usage.md Import the creopyson library to start using its functionalities. ```python import creopyson ``` -------------------------------- ### Install Stable Release with Pip Source: https://github.com/zepmanbc/creopyson/blob/master/docs/installation.md Use this command to install the latest stable version of Creopyson from PyPI. Ensure pip is installed. ```console pip install creopyson ``` -------------------------------- ### Creoson Response Example Source: https://github.com/zepmanbc/creopyson/blob/master/docs/usage.md Illustrates the expected structure of the data part of a Creoson response after a command execution. ```json {"dirname": "C:/your/working/path/", "files": ["my_file.prt"], "revision": 1} ``` -------------------------------- ### Launch Creo Source: https://github.com/zepmanbc/creopyson/blob/master/docs/usage.md Start the Creo application using the provided path to the remote batch file. ```python c.start_creo("path to nitro_proe_remote.bat") ``` -------------------------------- ### Clone Creopyson Repository Source: https://github.com/zepmanbc/creopyson/blob/master/docs/installation.md Clone the official Creopyson GitHub repository to get the source code. This is useful for development or installing directly from the latest code. ```console git clone git://github.com/Zepmanbc/creopyson ``` -------------------------------- ### Creoson Request and Response Log Output Source: https://github.com/zepmanbc/creopyson/blob/master/docs/usage.md Example console output demonstrating the DEBUG logs for Creoson requests and responses, including session IDs and command details. ```text DEBUG:creopyson.connection:request: {'sessionId': '', 'command': 'connection', 'function': 'connect', 'data': None} DEBUG:creopyson.connection:response: {'status': {'error': False}, 'sessionId': '-8685569143476874454'} DEBUG:creopyson.connection:request: {'sessionId': '-8685569143476874454', 'command': 'file', 'function': 'open', 'data': {'display': True, 'activate': True, 'file': 'my_file.prt'}} DEBUG:creopyson.connection:response: {'status': {'error': False}, 'data': {'revision': 1, 'files': ['MY_FILE.prt'], 'dirname': 'C:/your/working/path/'}} ``` -------------------------------- ### Basic File and Directory Operations Source: https://github.com/zepmanbc/creopyson/blob/master/docs/usage.md Perform common file system operations within Creo, such as getting the current directory, listing files and directories, changing directories, checking file existence, opening files, and modifying dimensions. ```python current_directory = c.creo_pwd() # return current working directory. listfiles = c.creo_list_files() # return a list in the working directory. listdirs = c.creo_list_dirs() # return a list of folders in the working directory. c.creo_cd("new_folder") # change working directory. c.file_exists("my_file.prt") # verify if `my_file.prt` exists. c.file_open("my_file.prt", display=True) # Open `my_file.prt` in Creo. c.dimension_set("my_file.prt", "diamm", 180) # Modify `diamm` dimension. c.file_regenerate("my_file.prt") # Regenerate file, raise `Warning` if regeneration fails. ``` -------------------------------- ### Connect to Creoson Source: https://github.com/zepmanbc/creopyson/blob/master/docs/usage.md Create a Client object and establish a connection with the Creoson server. ```python c = creopyson.Client() c.connect() ``` -------------------------------- ### Deploy New Version Source: https://github.com/zepmanbc/creopyson/blob/master/CONTRIBUTING.rst Update the version, tag the release, and push tags to deploy a new version. ```shell bumpversion patch # possible: major / minor / patch git tag -a vx.x.x -m "my version vx.x.x" # add the tag manualy if you don't use git-flow git push --tags ``` -------------------------------- ### Deploy New Version Source: https://github.com/zepmanbc/creopyson/blob/master/docs/contributing.md Update the version, tag, and push to deploy a new release to PyPI. ```shell $ bumpversion patch # possible: major / minor / patch $ git tag -a vx.x.x -m "my version vx.x.x" # add the tag manualy if you don't use git-flow $ git push --tags ``` -------------------------------- ### Clone Creopyson Repository Source: https://github.com/zepmanbc/creopyson/blob/master/CONTRIBUTING.rst Clone your forked repository locally to begin development. ```shell git clone git@github.com:your_name_here/creopyson.git ``` -------------------------------- ### Commit and Push Changes Source: https://github.com/zepmanbc/creopyson/blob/master/docs/contributing.md Stage, commit, and push your local changes to your forked repository. ```shell $ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature ``` -------------------------------- ### Run Code Quality and Tests Source: https://github.com/zepmanbc/creopyson/blob/master/docs/contributing.md Ensure your changes pass flake8 linting and all tests, including cross-version testing with tox. ```shell $ flake8 creopyson tests $ python setup.py test # or pytest $ tox ``` -------------------------------- ### Run Tests and Linting Source: https://github.com/zepmanbc/creopyson/blob/master/CONTRIBUTING.rst Ensure your changes pass linting with flake8 and all tests, including cross-version testing with tox. ```shell flake8 creopyson tests python setup.py test # or pytest tox ``` -------------------------------- ### Clone Creopyson Repository Source: https://github.com/zepmanbc/creopyson/blob/master/docs/contributing.md Clone your forked creopyson repository to your local machine. ```shell $ git clone git@github.com:your_name_here/creopyson.git ``` -------------------------------- ### Commit and Push Changes Source: https://github.com/zepmanbc/creopyson/blob/master/CONTRIBUTING.rst Commit your changes with a descriptive message and push the branch to your fork. ```shell git add . git commit -m "Your detailed description of your changes." git push origin name-of-your-bugfix-or-feature ``` -------------------------------- ### Create a New Branch Source: https://github.com/zepmanbc/creopyson/blob/master/docs/contributing.md Create a new branch for your bug fix or feature development. ```shell $ git checkout -b name-of-your-bugfix-or-feature ``` -------------------------------- ### Create a New Branch Source: https://github.com/zepmanbc/creopyson/blob/master/CONTRIBUTING.rst Create a new branch for your bug fix or feature development. ```shell git checkout -b name-of-your-bugfix-or-feature ``` -------------------------------- ### Enable Logging for Creoson Requests Source: https://github.com/zepmanbc/creopyson/blob/master/docs/usage.md Activate logging to view requests sent to Creoson. This is useful for debugging and understanding communication flow. It also shows how to suppress verbose urllib3 logs. ```python import logging logging.basicConfig(level=logging.DEBUG) # Hide urllib3 logging logging.getLogger("urllib3").setLevel(logging.WARNING) import creopyson c = creopyson.Client() c.connect() c.file_open("my_file.prt", display=True) ``` -------------------------------- ### Run a Subset of Tests Source: https://github.com/zepmanbc/creopyson/blob/master/docs/contributing.md Execute a specific test file using pytest to quickly verify changes. ```shell $ pytest tests/test_creo.py ``` -------------------------------- ### Run a Subset of Tests Source: https://github.com/zepmanbc/creopyson/blob/master/CONTRIBUTING.rst Execute a specific test file using pytest. ```shell pytest tests/test_creo.py ``` -------------------------------- ### Download Source Tarball Source: https://github.com/zepmanbc/creopyson/blob/master/docs/installation.md Download the source code archive (tarball) for Creopyson directly from GitHub. This method is an alternative to cloning the repository. ```console curl -OL https://github.com/Zepmanbc/creopyson/tarball/master ``` -------------------------------- ### Set Creo Version for Creo 7 Users Source: https://github.com/zepmanbc/creopyson/blob/master/docs/usage.md For Creo 7 users, declare the version once per session to avoid errors with deprecated features. ```python c.creo_set_creo_version(7) ``` -------------------------------- ### Direct Creoson Command Execution Source: https://github.com/zepmanbc/creopyson/blob/master/docs/usage.md Execute Creoson commands directly, primarily for debugging purposes. This involves specifying the command, function, and data payload. ```python import creopyson c = creopyson.Client() c.connect() # Here you define command/function # data is a dictionnary with data part of the JSON request # Please refer to Creoson documentation command = "file" function = "open" data ={"file":"my_file.prt", "display": True} result = c._creoson_post(command, function, data) ``` -------------------------------- ### Check if Creo is Running Source: https://github.com/zepmanbc/creopyson/blob/master/docs/usage.md Verify if the Creo application is currently running. Returns a boolean value. ```python c.is_creo_running() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.