Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Converts files from CSV to JSON formats and vice-versa.
This is meant to be used as the final project for the Python course from the Artificial Intelligence program at PUC Minas.
It has nothing groundbreaking, so you should safely ignore it. In any case, if you managed to get here, feel free to check my other (hopefully) more useful projects:
Python TSP <https://github.com/fillipe-gsm/python-tsp>
_: a TSP solver;Python Kanban <https://github.com/fillipe-gsm/python-kanban>
_: a Kanban board for the command line... code:: bash
pip install file-converter-fgsm
This assumes you are inside a virtual environment. If you wish to install it globally on the system (which I do not recommend for this class project), add sudo
at the beginning.
Once installed, a file_converter
command becomes available.
Type
.. code:: bash
file_converter --help
to get further help.
Suppose you have a file sample_file.csv
in the current directory with the contents
.. code:: csv
header1,header2,header3,header4 1,a,1.5, 2,b,3.2,info
To convert it into a json
format, run
.. code:: bash
file_converter --conversion=csv2json --input_path=./sample_file.csv
and then you should have a sample_file.json
in the same directory with the contents:
.. code:: json
[
{
"header1": 1,
"header2": "a",
"header3": 1.5,
"header4": null
},
{
"header1": 2,
"header2": "b",
"header3": 3.2,
"header4": "info"
}
]
Notice how the missing info became null
and each type was properly parsed.
The previous command is short for
.. code:: bash
file_converter --conversion=csv2json --input_path=./sample_file.csv --output_path=. --separator=, --prefix=""
Experiment running again but with a different --output_path
.
The command supports the other way for the conversion as well. To test that, let us convert the recently converted json
file but prefixing the resulting file name with a new_
:
.. code:: bash
file_converter --conversion=json2csv --input_path=./sample_file.json --prefix="new_"
Notice the csv2json
became json2csv
in the --conversion
attribute. Also, we should have a new_sample_file.csv
with the same contents of the first.
If instead of a single file path you pass a folder in the --input_path
parameter, the command will attempt to convert all files inside of it. Notice they all should have the same separator.
Experiment passing the current directory like
.. code:: bash
file_converter --conversion=csv2json --input_path=. --prefix="from_folder_"
If you followed the previous example, you should have two new json
files starting with from_folder_
.
FAQs
Class project to convert files from CSV to JSON and vice-versa
We found that file-converter-fgsm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.