# Defining new records in a .py file

**URL:** <https://invenio-talk.web.cern.ch/t/defining-new-records-in-a-py-file/437>\
**Category:** General Discussion\
**Created:** [20 November 2025 09:40 UTC](https://invenio-talk.web.cern.ch/t/defining-new-records-in-a-py-file/437 "2025-11-20T09:40:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpatil07](https://invenio-talk.web.cern.ch/user_avatar/invenio-talk.web.cern.ch/rpatil07/32/336_2.png) [@rpatil07](https://invenio-talk.web.cern.ch/u/rpatil07)\
**Post date:** [20 November 2025 09:40 UTC](https://invenio-talk.web.cern.ch/t/defining-new-records-in-a-py-file/437/1 "2025-11-20T09:40:14Z")

</div>

Hi, I am trying to create new fields in a different python file and import it in invenio.cfg but i am unable to understand where exactly i should i add this file. I am following this page but this one is more for the fields that can be created inside the invenio.cfg file. Is there any documentation on situations where the fields are coded in a different file? [Create new type of field - Turn-key research data management repository](https://inveniordm.docs.cern.ch/operate/customize/metadata/custom_fields/custom_fields/)

---

<div class="post-metadata">

**Author:** ![fenekku](https://invenio-talk.web.cern.ch/user_avatar/invenio-talk.web.cern.ch/fenekku/32/46_2.png) [@fenekku](https://invenio-talk.web.cern.ch/u/fenekku)\
**Post date:** [25 November 2025 17:27 UTC](https://invenio-talk.web.cern.ch/t/defining-new-records-in-a-py-file/437/2 "2025-11-25T17:27:12Z")

</div>

Hey there 👋 ,

invenio.cfg is actually just a python file with a different file ending, so you can do imports in it and import your code defined elsewhere. What a lot of people do is use their `site` package ([https://github.com/inveniosoftware/cookiecutter-invenio-rdm/tree/master/{{cookiecutter.project\_shortname}](https://github.com/inveniosoftware/cookiecutter-invenio-rdm/tree/master/%7B%7Bcookiecutter.project_shortname%7D)}/site) to define things like that and then import them it in their invenio.cfg. Use your site’s package name (what is used here: [https://github.com/inveniosoftware/cookiecutter-invenio-rdm/blob/master/{{cookiecutter.project\_shortname}](https://github.com/inveniosoftware/cookiecutter-invenio-rdm/blob/master/%7B%7Bcookiecutter.project_shortname%7D)}/site/setup.cfg#L3) in that case: `from <cookiecutter.project_shortname> import Foo`.

Also, you will have a better response rate for questions on our Discord server actually: [inveniosoftware](https://discord.com/invite/8qatqBC) . This discourse forum is not as watched. More users are there to help out and share their similar experience.

cheers,
