API best practices - REST or core?

I’m writing some code to update maillist owners based on data from another system.
Are there any specific recommendations around using either the REST API or core over the other? Either should work for my case.
Thanks,
Derek Lambert

I was referring to importing and using the core interfaces and models directly.
Based on your response I'm hearing that's probably not the best idea?
Thank, Derek
On 3/12/19, 12:34 PM, "Abhilash Raj" <maxking@asynchronous.in> wrote:
On Tue, Mar 12, 2019, at 9:19 AM, Derek Lambert wrote:
> I’m writing some code to update maillist owners based on data from
> another system.
>
> Are there any specific recommendations around using either the REST API
> or core over the other? Either should work for my case.
Core is the server which serves the REST API. If you meant REST API over
command line, then I would suggest that you go with REST API, which has way
more feature than CLI.
> Thanks,
>
> Derek Lambert
>
>
> _______________________________________________
> Mailman-Developers mailing list -- mailman-developers@python.org
> To unsubscribe send an email to mailman-developers-leave@python.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.python.org_mailman3_lists_mailman-2Ddevelopers.python.org_&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=krrJ0P6SRMfknUGnDT6UpMvvZHu8dsN6ekoZP9x19dw&e=
> Mailman FAQ: https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_AgA3&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=D-3uczrl8I2YfeH6PLI_e8jQma2isgfmHhABGaC1nr0&e=
>
> Security Policy: https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_QIA9&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=RuTdcxrQ4IJr9Da424UGNy99rc7msxFhCsYRhuoacT8&e=
>
--
thanks,
Abhilash Raj (maxking)
_______________________________________________
Mailman-Developers mailing list -- mailman-developers@python.org
To unsubscribe send an email to mailman-developers-leave@python.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.python.org_mailman3_lists_mailman-2Ddevelopers.python.org_&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=krrJ0P6SRMfknUGnDT6UpMvvZHu8dsN6ekoZP9x19dw&e=
Mailman FAQ: https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_AgA3&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=D-3uczrl8I2YfeH6PLI_e8jQma2isgfmHhABGaC1nr0&e=
Security Policy: https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_QIA9&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=RuTdcxrQ4IJr9Da424UGNy99rc7msxFhCsYRhuoacT8&e=

On 3/12/19 2:01 PM, Derek Lambert wrote:
I was referring to importing and using the core interfaces and models directly.
Based on your response I'm hearing that's probably not the best idea?
Right. That was the Mailman 2.1 way, but the whole idea behind the REST API is that it provides a stable interface for doing things that should be complete.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On Tue, Mar 12, 2019, at 2:01 PM, Derek Lambert wrote:
I was referring to importing and using the core interfaces and models directly.
Based on your response I'm hearing that's probably not the best idea?
Besides not being the best idea, there is no need to.
We have a Python API Client and an HTTP REST API, which should be easy enough to use. I would say it is probably harder for you to figure out internal models and their relationships to tinker with the models/database directly.
Also, the private APIs can change over time and it is preferable to the public APIs so that your out-of-band scripts don't break as we change internals of Mailman.
thanks, Abhilash
-- thanks, Abhilash Raj (maxking)

What package is the Python API client in? Is this what's documented at https://mailman.readthedocs.io/en/latest/src/mailman/model/docs/model.html?
This is what I was referring to by core.
Thanks, Derek
On 3/12/19, 4:48 PM, "Abhilash Raj" <maxking@asynchronous.in> wrote:
On Tue, Mar 12, 2019, at 2:01 PM, Derek Lambert wrote:
> I was referring to importing and using the core interfaces and models directly.
>
> Based on your response I'm hearing that's probably not the best idea?
Besides not being the best idea, there is no need to.
We have a Python API Client and an HTTP REST API, which should be easy enough to use. I would say it is probably harder for you to figure out internal models and their relationships to tinker with the models/database directly.
Also, the private APIs can change over time and it is preferable to the public APIs so that your out-of-band scripts don't break as we change internals of Mailman.
thanks,
Abhilash
>
> Thank,
> Derek
>
> On 3/12/19, 12:34 PM, "Abhilash Raj" <maxking@asynchronous.in> wrote:
>
> On Tue, Mar 12, 2019, at 9:19 AM, Derek Lambert wrote:
> > I’m writing some code to update maillist owners based on data from
> > another system.
> >
> > Are there any specific recommendations around using either the REST API
> > or core over the other? Either should work for my case.
>
> Core is the server which serves the REST API. If you meant REST API over
> command line, then I would suggest that you go with REST API, which has way
> more feature than CLI.
>
> > Thanks,
> >
> > Derek Lambert
> >
> >
> > _______________________________________________
> > Mailman-Developers mailing list -- mailman-developers@python.org
> > To unsubscribe send an email to
> mailman-developers-leave@python.org
> >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.python.org_mailman3_lists_mailman-2Ddevelopers.python.org_&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=krrJ0P6SRMfknUGnDT6UpMvvZHu8dsN6ekoZP9x19dw&e=
> > Mailman FAQ:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_AgA3&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=D-3uczrl8I2YfeH6PLI_e8jQma2isgfmHhABGaC1nr0&e=
> >
> > Security Policy:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_QIA9&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=RuTdcxrQ4IJr9Da424UGNy99rc7msxFhCsYRhuoacT8&e=
> >
>
> --
> thanks,
> Abhilash Raj (maxking)
> _______________________________________________
> Mailman-Developers mailing list -- mailman-developers@python.org
> To unsubscribe send an email to mailman-developers-leave@python.org
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.python.org_mailman3_lists_mailman-2Ddevelopers.python.org_&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=krrJ0P6SRMfknUGnDT6UpMvvZHu8dsN6ekoZP9x19dw&e=
> Mailman FAQ:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_AgA3&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=D-3uczrl8I2YfeH6PLI_e8jQma2isgfmHhABGaC1nr0&e=
>
> Security Policy:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_QIA9&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=RuTdcxrQ4IJr9Da424UGNy99rc7msxFhCsYRhuoacT8&e=
>
>
>
--
thanks,
Abhilash Raj (maxking)

Hello
Yes. I saw this at https://postorius.readthedocs.io/en/latest/setup.html and I am attaching the screenshot below.
Thanking You.
Saswat Mishra Sophomore B.Tech. I.I.T. Delhi
On Wed 13 Mar, 2019, 10:19 PM Abhilash Raj, <maxking@asynchronous.in> wrote:

On Wed, Mar 13, 2019, at 10:09 AM, Saswat Mishra wrote:
Hello
Yes. I saw this at https://postorius.readthedocs.io/en/latest/setup.html and I am attaching the screenshot below.
If you read the whole thing, it asks you to install a development version, i.e. latest version of MailmanClient from git.
Although, that can usually be done with a -U
flag in pip install
command, without having to install.
-- thanks, Abhilash Raj (maxking)

On Wed, Mar 13, 2019, at 10:23 AM, Saswat Mishra wrote:
Ok, thanks a lot : )
But why don't we need to uninstall Postorius or HyperKitty to git update them ?
Because you are already working on git-head of Postorius when you are developing Postorius. Postorius doesn't depend on Hyperkitty, so yo don't need to update that.
-- thanks, Abhilash Raj (maxking)

On 3/13/19 10:09 AM, Saswat Mishra wrote:
The URL and possibly a line # reference or copy/paste is sufficient. You don't need a screenshot. That just causes your message to be held for excessive size.
And, as Abhilash pointed out, the very next line below the one you circled says to reinstall mailmanclient from GitLab which is to ensure that you have the latest git HEAD for that as well.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

I was referring to importing and using the core interfaces and models directly.
Based on your response I'm hearing that's probably not the best idea?
Thank, Derek
On 3/12/19, 12:34 PM, "Abhilash Raj" <maxking@asynchronous.in> wrote:
On Tue, Mar 12, 2019, at 9:19 AM, Derek Lambert wrote:
> I’m writing some code to update maillist owners based on data from
> another system.
>
> Are there any specific recommendations around using either the REST API
> or core over the other? Either should work for my case.
Core is the server which serves the REST API. If you meant REST API over
command line, then I would suggest that you go with REST API, which has way
more feature than CLI.
> Thanks,
>
> Derek Lambert
>
>
> _______________________________________________
> Mailman-Developers mailing list -- mailman-developers@python.org
> To unsubscribe send an email to mailman-developers-leave@python.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.python.org_mailman3_lists_mailman-2Ddevelopers.python.org_&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=krrJ0P6SRMfknUGnDT6UpMvvZHu8dsN6ekoZP9x19dw&e=
> Mailman FAQ: https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_AgA3&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=D-3uczrl8I2YfeH6PLI_e8jQma2isgfmHhABGaC1nr0&e=
>
> Security Policy: https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_QIA9&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=RuTdcxrQ4IJr9Da424UGNy99rc7msxFhCsYRhuoacT8&e=
>
--
thanks,
Abhilash Raj (maxking)
_______________________________________________
Mailman-Developers mailing list -- mailman-developers@python.org
To unsubscribe send an email to mailman-developers-leave@python.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.python.org_mailman3_lists_mailman-2Ddevelopers.python.org_&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=krrJ0P6SRMfknUGnDT6UpMvvZHu8dsN6ekoZP9x19dw&e=
Mailman FAQ: https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_AgA3&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=D-3uczrl8I2YfeH6PLI_e8jQma2isgfmHhABGaC1nr0&e=
Security Policy: https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_QIA9&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=RuTdcxrQ4IJr9Da424UGNy99rc7msxFhCsYRhuoacT8&e=

On 3/12/19 2:01 PM, Derek Lambert wrote:
I was referring to importing and using the core interfaces and models directly.
Based on your response I'm hearing that's probably not the best idea?
Right. That was the Mailman 2.1 way, but the whole idea behind the REST API is that it provides a stable interface for doing things that should be complete.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

On Tue, Mar 12, 2019, at 2:01 PM, Derek Lambert wrote:
I was referring to importing and using the core interfaces and models directly.
Based on your response I'm hearing that's probably not the best idea?
Besides not being the best idea, there is no need to.
We have a Python API Client and an HTTP REST API, which should be easy enough to use. I would say it is probably harder for you to figure out internal models and their relationships to tinker with the models/database directly.
Also, the private APIs can change over time and it is preferable to the public APIs so that your out-of-band scripts don't break as we change internals of Mailman.
thanks, Abhilash
-- thanks, Abhilash Raj (maxking)

What package is the Python API client in? Is this what's documented at https://mailman.readthedocs.io/en/latest/src/mailman/model/docs/model.html?
This is what I was referring to by core.
Thanks, Derek
On 3/12/19, 4:48 PM, "Abhilash Raj" <maxking@asynchronous.in> wrote:
On Tue, Mar 12, 2019, at 2:01 PM, Derek Lambert wrote:
> I was referring to importing and using the core interfaces and models directly.
>
> Based on your response I'm hearing that's probably not the best idea?
Besides not being the best idea, there is no need to.
We have a Python API Client and an HTTP REST API, which should be easy enough to use. I would say it is probably harder for you to figure out internal models and their relationships to tinker with the models/database directly.
Also, the private APIs can change over time and it is preferable to the public APIs so that your out-of-band scripts don't break as we change internals of Mailman.
thanks,
Abhilash
>
> Thank,
> Derek
>
> On 3/12/19, 12:34 PM, "Abhilash Raj" <maxking@asynchronous.in> wrote:
>
> On Tue, Mar 12, 2019, at 9:19 AM, Derek Lambert wrote:
> > I’m writing some code to update maillist owners based on data from
> > another system.
> >
> > Are there any specific recommendations around using either the REST API
> > or core over the other? Either should work for my case.
>
> Core is the server which serves the REST API. If you meant REST API over
> command line, then I would suggest that you go with REST API, which has way
> more feature than CLI.
>
> > Thanks,
> >
> > Derek Lambert
> >
> >
> > _______________________________________________
> > Mailman-Developers mailing list -- mailman-developers@python.org
> > To unsubscribe send an email to
> mailman-developers-leave@python.org
> >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.python.org_mailman3_lists_mailman-2Ddevelopers.python.org_&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=krrJ0P6SRMfknUGnDT6UpMvvZHu8dsN6ekoZP9x19dw&e=
> > Mailman FAQ:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_AgA3&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=D-3uczrl8I2YfeH6PLI_e8jQma2isgfmHhABGaC1nr0&e=
> >
> > Security Policy:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_QIA9&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=RuTdcxrQ4IJr9Da424UGNy99rc7msxFhCsYRhuoacT8&e=
> >
>
> --
> thanks,
> Abhilash Raj (maxking)
> _______________________________________________
> Mailman-Developers mailing list -- mailman-developers@python.org
> To unsubscribe send an email to mailman-developers-leave@python.org
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__mail.python.org_mailman3_lists_mailman-2Ddevelopers.python.org_&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=krrJ0P6SRMfknUGnDT6UpMvvZHu8dsN6ekoZP9x19dw&e=
> Mailman FAQ:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_AgA3&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=D-3uczrl8I2YfeH6PLI_e8jQma2isgfmHhABGaC1nr0&e=
>
> Security Policy:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.list.org_x_QIA9&d=DwIGaQ&c=PzM68gSF_5r1R7BCE75oeA&r=GgD_LHpJpzqCgYl9euxHhlqYAOmF-LRf0L_q26FThVM&m=QAkYorciYIa-uBBr4N2QiycF0nnfaCT-k4ATfGCk96M&s=RuTdcxrQ4IJr9Da424UGNy99rc7msxFhCsYRhuoacT8&e=
>
>
>
--
thanks,
Abhilash Raj (maxking)

Hello
Yes. I saw this at https://postorius.readthedocs.io/en/latest/setup.html and I am attaching the screenshot below.
Thanking You.
Saswat Mishra Sophomore B.Tech. I.I.T. Delhi
On Wed 13 Mar, 2019, 10:19 PM Abhilash Raj, <maxking@asynchronous.in> wrote:

On Wed, Mar 13, 2019, at 10:09 AM, Saswat Mishra wrote:
Hello
Yes. I saw this at https://postorius.readthedocs.io/en/latest/setup.html and I am attaching the screenshot below.
If you read the whole thing, it asks you to install a development version, i.e. latest version of MailmanClient from git.
Although, that can usually be done with a -U
flag in pip install
command, without having to install.
-- thanks, Abhilash Raj (maxking)

On Wed, Mar 13, 2019, at 10:23 AM, Saswat Mishra wrote:
Ok, thanks a lot : )
But why don't we need to uninstall Postorius or HyperKitty to git update them ?
Because you are already working on git-head of Postorius when you are developing Postorius. Postorius doesn't depend on Hyperkitty, so yo don't need to update that.
-- thanks, Abhilash Raj (maxking)

On 3/13/19 10:09 AM, Saswat Mishra wrote:
The URL and possibly a line # reference or copy/paste is sufficient. You don't need a screenshot. That just causes your message to be held for excessive size.
And, as Abhilash pointed out, the very next line below the one you circled says to reinstall mailmanclient from GitLab which is to ensure that you have the latest git HEAD for that as well.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (4)
-
Abhilash Raj
-
Derek Lambert
-
Mark Sapiro
-
Saswat Mishra