pyjetbrains
Take the control over JetBrains IDEs Family with python code!
Installation
Pyjetbrains can be installed via Python Package Index (PyPi) command:
pip install pyjetbrains
Features
- Open IDE projects (whole folder)
- Open files for editing
- Open file at specific character and line
- Compare multiple files
- Format files
- Currently supports Windows only, Linux and Mac comming soon!
It also tries to search for installed path on it's own, so you don't have to specify location of any of installed IDE inside pyjetbrains.
For Toolbox Users: Toolbox installs with CLI path automatically so it's much easier to find jetbrains IDE with toolbox.
Documentation
All pyjetbrains have required parameter of IDE as value of Enum.
All methods have their documentation visible while using IDE!
Checking if IDE is Installed
Before using any of pyjetbrains method, pyjetbrains automatically checks whether is desired IDE installed or not, but you can check it manually.
import pyjetbrains
pyjetbrains.is_installed(pyjetbrains.IDE.PYCHARM)
Opening files and folders
For opening files or folders (as project) there is subprocess.open() method.
import pyjetbrains
pyjetbrains.open(
pyjetbrains.IDE.INTELLIJ_IDEA, # IDE
"hello_world.txt", # Path
line=5, # Line caret cursor position
column=7 # Column caret cursor position
)
pyjetbrains.open(
pyjetbrains.IDE.CLION, # IDE
"main.cpp", "hero.cpp", "vilain.cpp" # Multiple Paths
)
my_paths = ["main.cpp", "hero.cpp", "vilain.cpp"]
pyjetbrains.open(
pyjetbrains.IDE.PHPSTORM, # IDE
my_paths # Multiple paths passed as list
)
pyjetbrains.open(
pyjetbrains.IDE.RUBYMINE, # IDE
"my_awesome_project" # Folder which will open as project
)
Comparing files (2 up to 3 files)
Comparing files is done with pyjetbrains.compare_files() method, that takes
from two to three files. After execution, difference tab of provided paths is opened.
import pyjetbrains
pyjetbrains.compare_files(
pyjetbrains.IDE.PYCHARM, # IDE
"project1/main.py", # First path
"project2/main.py", # Second path
"project3/main.py" # Third path
)
Formating files
For formatting files you cannot have already opened instance of desired IDE, because Jetbrains assumes that you can use format command in IDE rather than do it with CLI.
Then you specify files or folders with code to format it with and whether it should be recursive.
About mask, here is cite from jetbrains site:
Specify a comma-separated list of file masks that define the files to be processed. You can use the * (any string) and ? (any single character) wildcards.
import pyjetbrains
pyjetbrains.format_files(
pyjetbrains.IDE.PYCHARM, # IDE
"my_python_project", # Paths to format (project folder in this case)
mask="file??.py", # File mask
recursive=True # Processing directories recursively
)
Metadata
Release files for pyjetbrains 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyjetbrains-1.1.0.tar.gz | 5.2 kB | Without provenance | Details for pyjetbrains-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyjetbrains-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for pyjetbrains-1.1.0-py3-none-any.whl |
Total release size: 11.4 kB
Release files / pyjetbrains-1.1.0.tar.gz
| Download URL | pyjetbrains-1.1.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4234f9927cca91fe0966b7182abf64f1512580bc37f677f96b16693f482ce4e
|
|
BLAKE2b-256 checksum How to use checksums |
8505eaffb5d93ae30c371437f1ea1f013b2c09ca81587654729b4633459f20fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Release files / pyjetbrains-1.1.0-py3-none-any.whl
| Download URL | pyjetbrains-1.1.0-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
be5b7562c9dc4b624cb88a29832e799b75bd52c68f23fc195c9b38f9aba10090
|
|
BLAKE2b-256 checksum How to use checksums |
776247cb6f430fb69ede7e719efb2d197691f454f69302755a4df3ce5ab3b8aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Security for pyjetbrains 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.